Skip to content

Commit

Permalink
Merge pull request #550 from LordJZ/case/global-type
Browse files Browse the repository at this point in the history
Display a reference to a module's global type.
  • Loading branch information
siegfriedpammer committed Mar 9, 2015
2 parents 6d5e8ec + 14bfdec commit 54c720c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ILSpy/Languages/CSharpLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ public override void DecompileAssembly(LoadedAssembly assembly, ITextOutput outp
base.DecompileAssembly(assembly, output, options);
output.WriteLine();
ModuleDefinition mainModule = assembly.ModuleDefinition;
if (mainModule.Types.Count > 0) {
output.Write("// Global type: ");
output.WriteReference(mainModule.Types[0].FullName, mainModule.Types[0]);
output.WriteLine();
}
if (mainModule.EntryPoint != null) {
output.Write("// Entry point: ");
output.WriteReference(mainModule.EntryPoint.DeclaringType.FullName + "." + mainModule.EntryPoint.Name, mainModule.EntryPoint);
Expand Down
5 changes: 5 additions & 0 deletions ILSpy/VB/VBLanguage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ public override void DecompileAssembly(LoadedAssembly assembly, ITextOutput outp
base.DecompileAssembly(assembly, output, options);
output.WriteLine();
ModuleDefinition mainModule = assembly.ModuleDefinition;
if (mainModule.Types.Count > 0) {
output.Write("// Global type: ");
output.WriteReference(mainModule.Types[0].FullName, mainModule.Types[0]);
output.WriteLine();
}
if (mainModule.EntryPoint != null) {
output.Write("' Entry point: ");
output.WriteReference(mainModule.EntryPoint.DeclaringType.FullName + "." + mainModule.EntryPoint.Name, mainModule.EntryPoint);
Expand Down

0 comments on commit 54c720c

Please sign in to comment.