diff --git a/ILSpy/ILSpy.csproj b/ILSpy/ILSpy.csproj index f61c643c4..db6d26eab 100644 --- a/ILSpy/ILSpy.csproj +++ b/ILSpy/ILSpy.csproj @@ -106,6 +106,7 @@ DebugSteps.xaml + diff --git a/ILSpy/Languages/CSharpILMixedLanguage.cs b/ILSpy/Languages/CSharpILMixedLanguage.cs new file mode 100644 index 000000000..9be3e0092 --- /dev/null +++ b/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); + } + } +}