diff --git a/ILSpy/AssemblyTreeNode.cs b/ILSpy/AssemblyTreeNode.cs index 8e66a8aa5..6e4e6f4ca 100644 --- a/ILSpy/AssemblyTreeNode.cs +++ b/ILSpy/AssemblyTreeNode.cs @@ -212,7 +212,7 @@ namespace ICSharpCode.ILSpy public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) { - language.DecompileAssembly(assemblyTask.Result, output, options); + language.DecompileAssembly(assemblyTask.Result, fileName, output, options); } } } diff --git a/ILSpy/Disassembler/ILLanguage.cs b/ILSpy/Disassembler/ILLanguage.cs index ee48c8098..6bd6f548c 100644 --- a/ILSpy/Disassembler/ILLanguage.cs +++ b/ILSpy/Disassembler/ILLanguage.cs @@ -18,6 +18,7 @@ using System; using System.Collections.Generic; +using System.IO; using Mono.Cecil; namespace ICSharpCode.ILSpy.Disassembler @@ -69,8 +70,11 @@ namespace ICSharpCode.ILSpy.Disassembler new ReflectionDisassembler(output, detectControlStructure, options.CancellationToken).DisassembleNamespace(nameSpace, types); } - public override void DecompileAssembly(AssemblyDefinition assembly, ITextOutput output, DecompilationOptions options) + public override void DecompileAssembly(AssemblyDefinition assembly, string fileName, ITextOutput output, DecompilationOptions options) { + output.WriteCommentLine("// " + fileName); + output.WriteCommentLine(""); + new ReflectionDisassembler(output, detectControlStructure, options.CancellationToken).WriteAssemblyHeader(assembly); } diff --git a/ILSpy/Language.cs b/ILSpy/Language.cs index 3beb2d238..8243107b8 100644 --- a/ILSpy/Language.cs +++ b/ILSpy/Language.cs @@ -60,7 +60,7 @@ namespace ICSharpCode.ILSpy { } - public virtual void DecompileAssembly(AssemblyDefinition assembly, ITextOutput output, DecompilationOptions options) + public virtual void DecompileAssembly(AssemblyDefinition assembly, string fileName, ITextOutput output, DecompilationOptions options) { } diff --git a/ILSpy/TextView/ILAsm-Mode.xshd b/ILSpy/TextView/ILAsm-Mode.xshd index 93ec0e8fe..5f582d37c 100644 --- a/ILSpy/TextView/ILAsm-Mode.xshd +++ b/ILSpy/TextView/ILAsm-Mode.xshd @@ -1,7 +1,6 @@  - @@ -504,10 +503,6 @@ " " - \b0[xX][0-9a-fA-F]+|\b(\d+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)? -