Browse Source

Add CSharpILMixedLanguage

pull/923/head
Siegfried Pammer 8 years ago
parent
commit
25cdf7d16a
  1. 1
      ILSpy/ILSpy.csproj
  2. 26
      ILSpy/Languages/CSharpILMixedLanguage.cs

1
ILSpy/ILSpy.csproj

@ -106,6 +106,7 @@
<DependentUpon>DebugSteps.xaml</DependentUpon> <DependentUpon>DebugSteps.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ILSpyTraceListener.cs" /> <Compile Include="ILSpyTraceListener.cs" />
<Compile Include="Languages\CSharpILMixedLanguage.cs" />
<Compile Include="Languages\CSharpLanguage.cs" /> <Compile Include="Languages\CSharpLanguage.cs" />
<Compile Include="DecompilationOptions.cs" /> <Compile Include="DecompilationOptions.cs" />
<Compile Include="ExtensionMethods.cs" /> <Compile Include="ExtensionMethods.cs" />

26
ILSpy/Languages/CSharpILMixedLanguage.cs

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Disassembler;
using Mono.Cecil;
namespace ICSharpCode.ILSpy
{
[Export(typeof(Language))]
class CSharpILMixedLanguage : Language
{
private readonly bool detectControlStructure = true;
public override string Name => "IL with C#";
public override string FileExtension => ".il";
public override void DecompileMethod(MethodDefinition method, ITextOutput output, DecompilationOptions options)
{
var dis = new ReflectionDisassembler(output, detectControlStructure, options.CancellationToken);
dis.DisassembleMethod(method);
}
}
}
Loading…
Cancel
Save