Browse Source

Refactor metadata tables to use TableIndex instead of HandleKind.

pull/3276/head
Siegfried Pammer 9 months ago
parent
commit
46a6696694
  1. 1
      ILSpy/Metadata/CoffHeaderTreeNode.cs
  2. 10
      ILSpy/Metadata/CorTables/AssemblyRefTableTreeNode.cs
  3. 10
      ILSpy/Metadata/CorTables/AssemblyTableTreeNode.cs
  4. 10
      ILSpy/Metadata/CorTables/ClassLayoutTableTreeNode.cs
  5. 10
      ILSpy/Metadata/CorTables/ConstantTableTreeNode.cs
  6. 10
      ILSpy/Metadata/CorTables/CustomAttributeTableTreeNode.cs
  7. 10
      ILSpy/Metadata/CorTables/DeclSecurityTableTreeNode.cs
  8. 10
      ILSpy/Metadata/CorTables/EventMapTableTreeNode.cs
  9. 10
      ILSpy/Metadata/CorTables/EventTableTreeNode.cs
  10. 10
      ILSpy/Metadata/CorTables/ExportedTypeTableTreeNode.cs
  11. 10
      ILSpy/Metadata/CorTables/FieldLayoutTableTreeNode.cs
  12. 10
      ILSpy/Metadata/CorTables/FieldMarshalTableTreeNode.cs
  13. 8
      ILSpy/Metadata/CorTables/FieldRVATableTreeNode.cs
  14. 30
      ILSpy/Metadata/CorTables/FieldTableTreeNode.cs
  15. 9
      ILSpy/Metadata/CorTables/FileTableTreeNode.cs
  16. 9
      ILSpy/Metadata/CorTables/GenericParamConstraintTableTreeNode.cs
  17. 10
      ILSpy/Metadata/CorTables/GenericParamTableTreeNode.cs
  18. 12
      ILSpy/Metadata/CorTables/ImplMapTableTreeNode.cs
  19. 10
      ILSpy/Metadata/CorTables/InterfaceImplTableTreeNode.cs
  20. 10
      ILSpy/Metadata/CorTables/ManifestResourceTableTreeNode.cs
  21. 10
      ILSpy/Metadata/CorTables/MemberRefTableTreeNode.cs
  22. 10
      ILSpy/Metadata/CorTables/MethodImplTableTreeNode.cs
  23. 10
      ILSpy/Metadata/CorTables/MethodSemanticsTableTreeNode.cs
  24. 9
      ILSpy/Metadata/CorTables/MethodSpecTableTreeNode.cs
  25. 10
      ILSpy/Metadata/CorTables/MethodTableTreeNode.cs
  26. 10
      ILSpy/Metadata/CorTables/ModuleRefTableTreeNode.cs
  27. 10
      ILSpy/Metadata/CorTables/ModuleTableTreeNode.cs
  28. 10
      ILSpy/Metadata/CorTables/NestedClassTableTreeNode.cs
  29. 10
      ILSpy/Metadata/CorTables/ParamTableTreeNode.cs
  30. 10
      ILSpy/Metadata/CorTables/PropertyMapTableTreeNode.cs
  31. 10
      ILSpy/Metadata/CorTables/PropertyTableTreeNode.cs
  32. 10
      ILSpy/Metadata/CorTables/StandAloneSigTableTreeNode.cs
  33. 9
      ILSpy/Metadata/CorTables/TypeDefTableTreeNode.cs
  34. 10
      ILSpy/Metadata/CorTables/TypeRefTableTreeNode.cs
  35. 9
      ILSpy/Metadata/CorTables/TypeSpecTableTreeNode.cs
  36. 1
      ILSpy/Metadata/DataDirectoriesTreeNode.cs
  37. 10
      ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs
  38. 10
      ILSpy/Metadata/DebugTables/DocumentTableTreeNode.cs
  39. 10
      ILSpy/Metadata/DebugTables/ImportScopeTableTreeNode.cs
  40. 10
      ILSpy/Metadata/DebugTables/LocalConstantTableTreeNode.cs
  41. 10
      ILSpy/Metadata/DebugTables/LocalScopeTableTreeNode.cs
  42. 10
      ILSpy/Metadata/DebugTables/LocalVariableTableTreeNode.cs
  43. 9
      ILSpy/Metadata/DebugTables/MethodDebugInformationTableTreeNode.cs
  44. 10
      ILSpy/Metadata/DebugTables/StateMachineMethodTableTreeNode.cs
  45. 1
      ILSpy/Metadata/DosHeaderTreeNode.cs
  46. 6
      ILSpy/Metadata/Heaps/BlobHeapTreeNode.cs
  47. 6
      ILSpy/Metadata/Heaps/GuidHeapTreeNode.cs
  48. 6
      ILSpy/Metadata/Heaps/StringHeapTreeNode.cs
  49. 6
      ILSpy/Metadata/Heaps/UserStringHeapTreeNode.cs
  50. 5
      ILSpy/Metadata/MetadataHeapTreeNode.cs
  51. 14
      ILSpy/Metadata/MetadataTableTreeNode.cs
  52. 2
      ILSpy/Metadata/MetadataTreeNode.cs

1
ILSpy/Metadata/CoffHeaderTreeNode.cs

@ -104,7 +104,6 @@ namespace ICSharpCode.ILSpy.Metadata
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{ {
language.WriteCommentLine(output, "COFF Header");
} }
} }

10
ILSpy/Metadata/CorTables/AssemblyRefTableTreeNode.cs

@ -22,7 +22,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -30,12 +29,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class AssemblyRefTableTreeNode : MetadataTableTreeNode internal class AssemblyRefTableTreeNode : MetadataTableTreeNode
{ {
public AssemblyRefTableTreeNode(MetadataFile metadataFile) public AssemblyRefTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.AssemblyReference, metadataFile) : base(TableIndex.AssemblyRef, metadataFile)
{ {
} }
public override object Text => $"23 AssemblyRef ({metadataFile.Metadata.GetTableRowCount(TableIndex.AssemblyRef)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -116,10 +113,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.assemblyRef = metadataFile.Metadata.GetAssemblyReference(handle); this.assemblyRef = metadataFile.Metadata.GetAssemblyReference(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "AssemblyRef");
}
} }
} }

10
ILSpy/Metadata/CorTables/AssemblyTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class AssemblyTableTreeNode : MetadataTableTreeNode internal class AssemblyTableTreeNode : MetadataTableTreeNode
{ {
public AssemblyTableTreeNode(MetadataFile metadataFile) public AssemblyTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.AssemblyDefinition, metadataFile) : base(TableIndex.Assembly, metadataFile)
{ {
} }
public override object Text => $"20 Assembly ({metadataFile.Metadata.GetTableRowCount(TableIndex.Assembly)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -99,10 +96,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.assembly = metadata.GetAssemblyDefinition(); this.assembly = metadata.GetAssemblyDefinition();
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Assembly");
}
} }
} }

10
ILSpy/Metadata/CorTables/ClassLayoutTableTreeNode.cs

@ -22,7 +22,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -30,12 +29,10 @@ namespace ICSharpCode.ILSpy.Metadata
class ClassLayoutTableTreeNode : MetadataTableTreeNode class ClassLayoutTableTreeNode : MetadataTableTreeNode
{ {
public ClassLayoutTableTreeNode(MetadataFile metadataFile) public ClassLayoutTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x0F, metadataFile) : base(TableIndex.ClassLayout, metadataFile)
{ {
} }
public override object Text => $"0F ClassLayout ({metadataFile.Metadata.GetTableRowCount(TableIndex.ClassLayout)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -124,10 +121,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.parentTooltip = null; this.parentTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "ClassLayouts");
}
} }
} }

10
ILSpy/Metadata/CorTables/ConstantTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.ILSpy.ViewModels; using ICSharpCode.ILSpy.ViewModels;
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class ConstantTableTreeNode : MetadataTableTreeNode internal class ConstantTableTreeNode : MetadataTableTreeNode
{ {
public ConstantTableTreeNode(MetadataFile metadataFile) public ConstantTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x0B, metadataFile) : base(TableIndex.Constant, metadataFile)
{ {
} }
public override object Text => $"0B Constant ({metadataFile.Metadata.GetTableRowCount(TableIndex.Constant)})";
public override bool View(TabPageModel tabPage) public override bool View(TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -114,10 +111,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.parentTooltip = null; this.parentTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Constants");
}
} }
} }

10
ILSpy/Metadata/CorTables/CustomAttributeTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
class CustomAttributeTableTreeNode : MetadataTableTreeNode class CustomAttributeTableTreeNode : MetadataTableTreeNode
{ {
public CustomAttributeTableTreeNode(MetadataFile metadataFile) public CustomAttributeTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.CustomAttribute, metadataFile) : base(TableIndex.CustomAttribute, metadataFile)
{ {
} }
public override object Text => $"0C CustomAttribute ({metadataFile.Metadata.GetTableRowCount(TableIndex.CustomAttribute)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -121,10 +118,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.constructorTooltip = null; this.constructorTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "CustomAttributes");
}
} }
} }

10
ILSpy/Metadata/CorTables/DeclSecurityTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
class DeclSecurityTableTreeNode : MetadataTableTreeNode class DeclSecurityTableTreeNode : MetadataTableTreeNode
{ {
public DeclSecurityTableTreeNode(MetadataFile metadataFile) public DeclSecurityTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.DeclarativeSecurityAttribute, metadataFile) : base(TableIndex.DeclSecurity, metadataFile)
{ {
} }
public override object Text => $"0E DeclSecurity ({metadataFile.Metadata.GetTableRowCount(TableIndex.DeclSecurity)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -119,10 +116,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.parentTooltip = null; this.parentTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "DeclSecurityAttrs");
}
} }
} }

10
ILSpy/Metadata/CorTables/EventMapTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
class EventMapTableTreeNode : MetadataTableTreeNode class EventMapTableTreeNode : MetadataTableTreeNode
{ {
public EventMapTableTreeNode(MetadataFile metadataFile) public EventMapTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x12, metadataFile) : base(TableIndex.EventMap, metadataFile)
{ {
} }
public override object Text => $"12 EventMap ({metadataFile.Metadata.GetTableRowCount(TableIndex.EventMap)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -129,10 +126,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.eventListTooltip = null; this.eventListTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "EventMap");
}
} }
} }

10
ILSpy/Metadata/CorTables/EventTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
@ -31,12 +30,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class EventTableTreeNode : MetadataTableTreeNode internal class EventTableTreeNode : MetadataTableTreeNode
{ {
public EventTableTreeNode(MetadataFile metadataFile) public EventTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.EventDefinition, metadataFile) : base(TableIndex.Event, metadataFile)
{ {
} }
public override object Text => $"14 Event ({metadataFile.Metadata.GetTableRowCount(TableIndex.Event)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -120,10 +117,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.typeTooltip = null; this.typeTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "EventDefs");
}
} }
} }

10
ILSpy/Metadata/CorTables/ExportedTypeTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class ExportedTypeTableTreeNode : MetadataTableTreeNode internal class ExportedTypeTableTreeNode : MetadataTableTreeNode
{ {
public ExportedTypeTableTreeNode(MetadataFile metadataFile) public ExportedTypeTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.ExportedType, metadataFile) : base(TableIndex.ExportedType, metadataFile)
{ {
} }
public override object Text => $"27 ExportedType ({metadataFile.Metadata.GetTableRowCount(TableIndex.ExportedType)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -124,10 +121,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.implementationTooltip = null; this.implementationTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "ExportedType");
}
} }
} }

10
ILSpy/Metadata/CorTables/FieldLayoutTableTreeNode.cs

@ -22,7 +22,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -30,12 +29,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class FieldLayoutTableTreeNode : MetadataTableTreeNode internal class FieldLayoutTableTreeNode : MetadataTableTreeNode
{ {
public FieldLayoutTableTreeNode(MetadataFile metadataFile) public FieldLayoutTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x10, metadataFile) : base(TableIndex.FieldLayout, metadataFile)
{ {
} }
public override object Text => $"10 FieldLayout ({metadataFile.Metadata.GetTableRowCount(TableIndex.FieldLayout)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -120,10 +117,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.fieldTooltip = null; this.fieldTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "FieldLayouts");
}
} }
} }

10
ILSpy/Metadata/CorTables/FieldMarshalTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class FieldMarshalTableTreeNode : MetadataTableTreeNode internal class FieldMarshalTableTreeNode : MetadataTableTreeNode
{ {
public FieldMarshalTableTreeNode(MetadataFile metadataFile) public FieldMarshalTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x0D, metadataFile) : base(TableIndex.FieldMarshal, metadataFile)
{ {
} }
public override object Text => $"0D FieldMarshal ({metadataFile.Metadata.GetTableRowCount(TableIndex.FieldMarshal)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -120,10 +117,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.parentTooltip = null; this.parentTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "FieldMarshals");
}
} }
} }

8
ILSpy/Metadata/CorTables/FieldRVATableTreeNode.cs

@ -22,7 +22,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -30,7 +29,7 @@ namespace ICSharpCode.ILSpy.Metadata
internal class FieldRVATableTreeNode : MetadataTableTreeNode internal class FieldRVATableTreeNode : MetadataTableTreeNode
{ {
public FieldRVATableTreeNode(MetadataFile metadataFile) public FieldRVATableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x1D, metadataFile) : base(TableIndex.FieldRva, metadataFile)
{ {
} }
@ -121,10 +120,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.fieldTooltip = null; this.fieldTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "FieldRVAs");
}
} }
} }

30
ILSpy/Metadata/CorTables/FieldTableTreeNode.cs

@ -16,13 +16,11 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
@ -32,12 +30,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class FieldTableTreeNode : MetadataTableTreeNode internal class FieldTableTreeNode : MetadataTableTreeNode
{ {
public FieldTableTreeNode(MetadataFile metadataFile) public FieldTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.FieldDefinition, metadataFile) : base(TableIndex.Field, metadataFile)
{ {
} }
public override object Text => $"04 Field ({metadataFile.Metadata.GetTableRowCount(TableIndex.Field)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -115,29 +111,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.signatureTooltip = null; this.signatureTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "FieldDefs");
}
}
}
class Time : IDisposable
{
readonly System.Diagnostics.Stopwatch stopwatch;
readonly string title;
public Time(string title)
{
this.title = title;
this.stopwatch = new System.Diagnostics.Stopwatch();
stopwatch.Start();
}
public void Dispose()
{
stopwatch.Stop();
System.Diagnostics.Debug.WriteLine(title + " took " + stopwatch.ElapsedMilliseconds + "ms");
} }
} }

9
ILSpy/Metadata/CorTables/FileTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
class FileTableTreeNode : MetadataTableTreeNode class FileTableTreeNode : MetadataTableTreeNode
{ {
public FileTableTreeNode(MetadataFile metadataFile) public FileTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.AssemblyFile, metadataFile) : base(TableIndex.File, metadataFile)
{ {
} }
public override object Text => $"26 File ({metadataFile.Metadata.GetTableRowCount(TableIndex.File)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -110,9 +107,5 @@ namespace ICSharpCode.ILSpy.Metadata
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Files");
}
} }
} }

9
ILSpy/Metadata/CorTables/GenericParamConstraintTableTreeNode.cs

@ -29,12 +29,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class GenericParamConstraintTableTreeNode : MetadataTableTreeNode internal class GenericParamConstraintTableTreeNode : MetadataTableTreeNode
{ {
public GenericParamConstraintTableTreeNode(MetadataFile metadataFile) public GenericParamConstraintTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.GenericParameterConstraint, metadataFile) : base(TableIndex.GenericParamConstraint, metadataFile)
{ {
} }
public override object Text => $"2C GenericParamConstraint ({metadataFile.Metadata.GetTableRowCount(TableIndex.GenericParamConstraint)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -125,10 +123,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.typeTooltip = null; this.typeTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "GenericParamConstraints");
}
} }
} }

10
ILSpy/Metadata/CorTables/GenericParamTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class GenericParamTableTreeNode : MetadataTableTreeNode internal class GenericParamTableTreeNode : MetadataTableTreeNode
{ {
public GenericParamTableTreeNode(MetadataFile metadataFile) public GenericParamTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.GenericParameter, metadataFile) : base(TableIndex.GenericParam, metadataFile)
{ {
} }
public override object Text => $"2A GenericParam ({metadataFile.Metadata.GetTableRowCount(TableIndex.GenericParam)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -113,10 +110,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.ownerTooltip = null; this.ownerTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "GenericParams");
}
} }
} }

12
ILSpy/Metadata/CorTables/ImplMapTableTreeNode.cs

@ -22,7 +22,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using Mono.Cecil; using Mono.Cecil;
@ -32,14 +31,10 @@ namespace ICSharpCode.ILSpy.Metadata
class ImplMapTableTreeNode : MetadataTableTreeNode class ImplMapTableTreeNode : MetadataTableTreeNode
{ {
public ImplMapTableTreeNode(MetadataFile metadataFile) public ImplMapTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x1C, metadataFile) : base(TableIndex.ImplMap, metadataFile)
{ {
} }
public override object Text => $"1C ImplMap ({metadataFile.Metadata.GetTableRowCount(TableIndex.ImplMap)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -154,10 +149,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.memberForwardedTooltip = null; this.memberForwardedTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "ImplMap");
}
} }
} }

10
ILSpy/Metadata/CorTables/InterfaceImplTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
class InterfaceImplTableTreeNode : MetadataTableTreeNode class InterfaceImplTableTreeNode : MetadataTableTreeNode
{ {
public InterfaceImplTableTreeNode(MetadataFile metadataFile) public InterfaceImplTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x09, metadataFile) : base(TableIndex.InterfaceImpl, metadataFile)
{ {
} }
public override object Text => $"09 InterfaceImpl ({metadataFile.Metadata.GetTableRowCount(TableIndex.InterfaceImpl)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -128,10 +125,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.classTooltip = null; this.classTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "InterfaceImpls");
}
} }
} }

10
ILSpy/Metadata/CorTables/ManifestResourceTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
class ManifestResourceTableTreeNode : MetadataTableTreeNode class ManifestResourceTableTreeNode : MetadataTableTreeNode
{ {
public ManifestResourceTableTreeNode(MetadataFile metadataFile) public ManifestResourceTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.ManifestResource, metadataFile) : base(TableIndex.ManifestResource, metadataFile)
{ {
} }
public override object Text => $"28 ManifestResource ({metadataFile.Metadata.GetTableRowCount(TableIndex.ManifestResource)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -110,10 +107,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.implementationTooltip = null; this.implementationTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "ManifestResources");
}
} }
} }

10
ILSpy/Metadata/CorTables/MemberRefTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class MemberRefTableTreeNode : MetadataTableTreeNode internal class MemberRefTableTreeNode : MetadataTableTreeNode
{ {
public MemberRefTableTreeNode(MetadataFile metadataFile) public MemberRefTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.MemberReference, metadataFile) : base(TableIndex.MemberRef, metadataFile)
{ {
} }
public override object Text => $"0A MemberRef ({metadataFile.Metadata.GetTableRowCount(TableIndex.MemberRef)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -111,10 +108,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.parentTooltip = null; this.parentTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "MemberRefs");
}
} }
} }

10
ILSpy/Metadata/CorTables/MethodImplTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class MethodImplTableTreeNode : MetadataTableTreeNode internal class MethodImplTableTreeNode : MetadataTableTreeNode
{ {
public MethodImplTableTreeNode(MetadataFile metadataFile) public MethodImplTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x19, metadataFile) : base(TableIndex.MethodImpl, metadataFile)
{ {
} }
public override object Text => $"19 MethodImpl ({metadataFile.Metadata.GetTableRowCount(TableIndex.MethodImpl)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -123,10 +120,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.methodDeclarationTooltip = null; this.methodDeclarationTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "MethodImpls");
}
} }
} }

10
ILSpy/Metadata/CorTables/MethodSemanticsTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class MethodSemanticsTableTreeNode : MetadataTableTreeNode internal class MethodSemanticsTableTreeNode : MetadataTableTreeNode
{ {
public MethodSemanticsTableTreeNode(MetadataFile metadataFile) public MethodSemanticsTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x18, metadataFile) : base(TableIndex.MethodSemantics, metadataFile)
{ {
} }
public override object Text => $"18 MethodSemantics ({metadataFile.Metadata.GetTableRowCount(TableIndex.MethodSemantics)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -121,10 +118,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.associationTooltip = null; this.associationTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "MethodDefs");
}
} }
} }

9
ILSpy/Metadata/CorTables/MethodSpecTableTreeNode.cs

@ -29,12 +29,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class MethodSpecTableTreeNode : MetadataTableTreeNode internal class MethodSpecTableTreeNode : MetadataTableTreeNode
{ {
public MethodSpecTableTreeNode(MetadataFile metadataFile) public MethodSpecTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.MethodSpecification, metadataFile) : base(TableIndex.MethodSpec, metadataFile)
{ {
} }
public override object Text => $"2B MethodSpec ({metadataFile.Metadata.GetTableRowCount(TableIndex.MethodSpec)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -121,10 +119,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.methodTooltip = null; this.methodTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "MethodSpecs");
}
} }
} }

10
ILSpy/Metadata/CorTables/MethodTableTreeNode.cs

@ -22,7 +22,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
@ -32,12 +31,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class MethodTableTreeNode : MetadataTableTreeNode internal class MethodTableTreeNode : MetadataTableTreeNode
{ {
public MethodTableTreeNode(MetadataFile metadataFile) public MethodTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.MethodDefinition, metadataFile) : base(TableIndex.MethodDef, metadataFile)
{ {
} }
public override object Text => $"06 Method ({metadataFile.Metadata.GetTableRowCount(TableIndex.MethodDef)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -145,10 +142,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.paramListTooltip = null; this.paramListTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "MethodDefs");
}
} }
} }

10
ILSpy/Metadata/CorTables/ModuleRefTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class ModuleRefTableTreeNode : MetadataTableTreeNode internal class ModuleRefTableTreeNode : MetadataTableTreeNode
{ {
public ModuleRefTableTreeNode(MetadataFile metadataFile) public ModuleRefTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.ModuleReference, metadataFile) : base(TableIndex.ModuleRef, metadataFile)
{ {
} }
public override object Text => $"1A ModuleRef ({metadataFile.Metadata.GetTableRowCount(TableIndex.ModuleRef)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -92,10 +89,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.moduleRef = metadataFile.Metadata.GetModuleReference(handle); this.moduleRef = metadataFile.Metadata.GetModuleReference(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "ModuleRefs");
}
} }
} }

10
ILSpy/Metadata/CorTables/ModuleTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class ModuleTableTreeNode : MetadataTableTreeNode internal class ModuleTableTreeNode : MetadataTableTreeNode
{ {
public ModuleTableTreeNode(MetadataFile metadataFile) public ModuleTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.ModuleDefinition, metadataFile) : base(TableIndex.Module, metadataFile)
{ {
} }
public override object Text => $"00 Module ({metadataFile.Metadata.GetTableRowCount(TableIndex.Module)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -100,10 +97,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.moduleDef = metadataFile.Metadata.GetModuleDefinition(); this.moduleDef = metadataFile.Metadata.GetModuleDefinition();
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Modules");
}
} }
} }

10
ILSpy/Metadata/CorTables/NestedClassTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
class NestedClassTableTreeNode : MetadataTableTreeNode class NestedClassTableTreeNode : MetadataTableTreeNode
{ {
public NestedClassTableTreeNode(MetadataFile metadataFile) public NestedClassTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x29, metadataFile) : base(TableIndex.NestedClass, metadataFile)
{ {
} }
public override object Text => $"29 NestedClass ({metadataFile.Metadata.GetTableRowCount(TableIndex.NestedClass)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -128,10 +125,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.enclosingClassTooltip = null; this.enclosingClassTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "NestedClass");
}
} }
} }

10
ILSpy/Metadata/CorTables/ParamTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class ParamTableTreeNode : MetadataTableTreeNode internal class ParamTableTreeNode : MetadataTableTreeNode
{ {
public ParamTableTreeNode(MetadataFile metadataFile) public ParamTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.Parameter, metadataFile) : base(TableIndex.Param, metadataFile)
{ {
} }
public override object Text => $"08 Param ({metadataFile.Metadata.GetTableRowCount(TableIndex.Param)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -101,10 +98,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.param = metadataFile.Metadata.GetParameter(handle); this.param = metadataFile.Metadata.GetParameter(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Params");
}
} }
} }

10
ILSpy/Metadata/CorTables/PropertyMapTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
class PropertyMapTableTreeNode : MetadataTableTreeNode class PropertyMapTableTreeNode : MetadataTableTreeNode
{ {
public PropertyMapTableTreeNode(MetadataFile metadataFile) public PropertyMapTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x15, metadataFile) : base(TableIndex.PropertyMap, metadataFile)
{ {
} }
public override object Text => $"15 PropertyMap ({metadataFile.Metadata.GetTableRowCount(TableIndex.PropertyMap)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -129,10 +126,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.parentTooltip = null; this.parentTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "PropertyMap");
}
} }
} }

10
ILSpy/Metadata/CorTables/PropertyTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Reflection;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
@ -31,12 +30,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class PropertyTableTreeNode : MetadataTableTreeNode internal class PropertyTableTreeNode : MetadataTableTreeNode
{ {
public PropertyTableTreeNode(MetadataFile metadataFile) public PropertyTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.PropertyDefinition, metadataFile) : base(TableIndex.Property, metadataFile)
{ {
} }
public override object Text => $"17 Property ({metadataFile.Metadata.GetTableRowCount(TableIndex.Property)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -111,10 +108,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.signatureTooltip = null; this.signatureTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "PropertyDefs");
}
} }
} }

10
ILSpy/Metadata/CorTables/StandAloneSigTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
class StandAloneSigTableTreeNode : MetadataTableTreeNode class StandAloneSigTableTreeNode : MetadataTableTreeNode
{ {
public StandAloneSigTableTreeNode(MetadataFile metadataFile) public StandAloneSigTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.StandaloneSignature, metadataFile) : base(TableIndex.StandAloneSig, metadataFile)
{ {
} }
public override object Text => $"11 StandAloneSig ({metadataFile.Metadata.GetTableRowCount(TableIndex.StandAloneSig)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -94,10 +91,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.signatureTooltip = null; this.signatureTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "StandAloneSigs");
}
} }
} }

9
ILSpy/Metadata/CorTables/TypeDefTableTreeNode.cs

@ -33,12 +33,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class TypeDefTableTreeNode : MetadataTableTreeNode internal class TypeDefTableTreeNode : MetadataTableTreeNode
{ {
public TypeDefTableTreeNode(MetadataFile metadataFile) public TypeDefTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.TypeDefinition, metadataFile) : base(TableIndex.TypeDef, metadataFile)
{ {
} }
public override object Text => $"02 TypeDef ({metadataFile.Metadata.GetTableRowCount(TableIndex.TypeDef)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -186,10 +184,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.fieldListTooltip = null; this.fieldListTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "TypeDefs");
}
} }
} }

10
ILSpy/Metadata/CorTables/TypeRefTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class TypeRefTableTreeNode : MetadataTableTreeNode internal class TypeRefTableTreeNode : MetadataTableTreeNode
{ {
public TypeRefTableTreeNode(MetadataFile metadataFile) public TypeRefTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.TypeReference, metadataFile) : base(TableIndex.TypeRef, metadataFile)
{ {
} }
public override object Text => $"01 TypeRef ({metadataFile.Metadata.GetTableRowCount(TableIndex.TypeRef)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -108,10 +105,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.resolutionScopeTooltip = null; this.resolutionScopeTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "TypeRefs");
}
} }
} }

9
ILSpy/Metadata/CorTables/TypeSpecTableTreeNode.cs

@ -29,12 +29,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class TypeSpecTableTreeNode : MetadataTableTreeNode internal class TypeSpecTableTreeNode : MetadataTableTreeNode
{ {
public TypeSpecTableTreeNode(MetadataFile metadataFile) public TypeSpecTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.TypeSpecification, metadataFile) : base(TableIndex.TypeSpec, metadataFile)
{ {
} }
public override object Text => $"1B TypeSpec ({metadataFile.Metadata.GetTableRowCount(TableIndex.TypeSpec)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -104,10 +102,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.typeSpec = metadata.GetTypeSpecification(handle); this.typeSpec = metadata.GetTypeSpecification(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "TypeSpecs");
}
} }
} }

1
ILSpy/Metadata/DataDirectoriesTreeNode.cs

@ -78,7 +78,6 @@ namespace ICSharpCode.ILSpy.Metadata
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{ {
language.WriteCommentLine(output, "Data Directories");
} }
class DataDirectoryEntry class DataDirectoryEntry

10
ILSpy/Metadata/DebugTables/CustomDebugInformationTableTreeNode.cs

@ -24,7 +24,6 @@ using System.Reflection.Metadata.Ecma335;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.DebugInfo; using ICSharpCode.Decompiler.DebugInfo;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
@ -33,12 +32,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class CustomDebugInformationTableTreeNode : DebugMetadataTableTreeNode internal class CustomDebugInformationTableTreeNode : DebugMetadataTableTreeNode
{ {
public CustomDebugInformationTableTreeNode(MetadataFile metadataFile) public CustomDebugInformationTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.CustomDebugInformation, metadataFile) : base(TableIndex.CustomDebugInformation, metadataFile)
{ {
} }
public override object Text => $"37 CustomDebugInformation ({metadataFile.Metadata.GetTableRowCount(TableIndex.CustomDebugInformation)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -323,10 +320,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.kind = GetKind(metadataFile.Metadata, debugInfo.Kind); this.kind = GetKind(metadataFile.Metadata, debugInfo.Kind);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "CustomDebugInformation");
}
} }
} }

10
ILSpy/Metadata/DebugTables/DocumentTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.DebugInfo; using ICSharpCode.Decompiler.DebugInfo;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
@ -30,12 +29,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class DocumentTableTreeNode : DebugMetadataTableTreeNode internal class DocumentTableTreeNode : DebugMetadataTableTreeNode
{ {
public DocumentTableTreeNode(MetadataFile metadataFile) public DocumentTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.Document, metadataFile) : base(TableIndex.Document, metadataFile)
{ {
} }
public override object Text => $"30 Document ({metadataFile.Metadata.GetTableRowCount(TableIndex.Document)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -139,10 +136,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.document = metadataFile.Metadata.GetDocument(handle); this.document = metadataFile.Metadata.GetDocument(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Document");
}
} }
} }

10
ILSpy/Metadata/DebugTables/ImportScopeTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class ImportScopeTableTreeNode : DebugMetadataTableTreeNode internal class ImportScopeTableTreeNode : DebugMetadataTableTreeNode
{ {
public ImportScopeTableTreeNode(MetadataFile metadataFile) public ImportScopeTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.ImportScope, metadataFile) : base(TableIndex.ImportScope, metadataFile)
{ {
} }
public override object Text => $"35 ImportScope ({metadataFile.Metadata.GetTableRowCount(TableIndex.ImportScope)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -98,10 +95,5 @@ namespace ICSharpCode.ILSpy.Metadata
+ metadataFile.Metadata.GetTableRowSize(TableIndex.ImportScope) * (MetadataTokens.GetRowNumber(handle) - 1); + metadataFile.Metadata.GetTableRowSize(TableIndex.ImportScope) * (MetadataTokens.GetRowNumber(handle) - 1);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "ImportScope");
}
} }
} }

10
ILSpy/Metadata/DebugTables/LocalConstantTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class LocalConstantTableTreeNode : DebugMetadataTableTreeNode internal class LocalConstantTableTreeNode : DebugMetadataTableTreeNode
{ {
public LocalConstantTableTreeNode(MetadataFile metadataFile) public LocalConstantTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.LocalConstant, metadataFile) : base(TableIndex.LocalConstant, metadataFile)
{ {
} }
public override object Text => $"34 LocalConstant ({metadataFile.Metadata.GetTableRowCount(TableIndex.LocalConstant)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -94,10 +91,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.localConst = metadataFile.Metadata.GetLocalConstant(handle); this.localConst = metadataFile.Metadata.GetLocalConstant(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Document");
}
} }
} }

10
ILSpy/Metadata/DebugTables/LocalScopeTableTreeNode.cs

@ -21,7 +21,6 @@ using System.Linq;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -29,12 +28,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class LocalScopeTableTreeNode : DebugMetadataTableTreeNode internal class LocalScopeTableTreeNode : DebugMetadataTableTreeNode
{ {
public LocalScopeTableTreeNode(MetadataFile metadataFile) public LocalScopeTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.LocalScope, metadataFile) : base(TableIndex.LocalScope, metadataFile)
{ {
} }
public override object Text => $"32 LocalScope ({metadataFile.Metadata.GetTableRowCount(TableIndex.LocalScope)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -128,10 +125,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.methodTooltip = null; this.methodTooltip = null;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "LocalScope");
}
} }
} }

10
ILSpy/Metadata/DebugTables/LocalVariableTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class LocalVariableTableTreeNode : DebugMetadataTableTreeNode internal class LocalVariableTableTreeNode : DebugMetadataTableTreeNode
{ {
public LocalVariableTableTreeNode(MetadataFile metadataFile) public LocalVariableTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.LocalVariable, metadataFile) : base(TableIndex.LocalVariable, metadataFile)
{ {
} }
public override object Text => $"33 LocalVariable ({metadataFile.Metadata.GetTableRowCount(TableIndex.LocalVariable)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -100,10 +97,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.localVar = metadataFile.Metadata.GetLocalVariable(handle); this.localVar = metadataFile.Metadata.GetLocalVariable(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Document");
}
} }
} }

9
ILSpy/Metadata/DebugTables/MethodDebugInformationTableTreeNode.cs

@ -30,12 +30,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class MethodDebugInformationTableTreeNode : DebugMetadataTableTreeNode internal class MethodDebugInformationTableTreeNode : DebugMetadataTableTreeNode
{ {
public MethodDebugInformationTableTreeNode(MetadataFile metadataFile) public MethodDebugInformationTableTreeNode(MetadataFile metadataFile)
: base(HandleKind.MethodDebugInformation, metadataFile) : base(TableIndex.MethodDebugInformation, metadataFile)
{ {
} }
public override object Text => $"31 MethodDebugInformation ({metadataFile.Metadata.GetTableRowCount(TableIndex.MethodDebugInformation)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -151,10 +149,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.debugInfo = metadataFile.Metadata.GetMethodDebugInformation(handle); this.debugInfo = metadataFile.Metadata.GetMethodDebugInformation(handle);
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "MethodDebugInformation");
}
} }
} }

10
ILSpy/Metadata/DebugTables/StateMachineMethodTableTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -28,12 +27,10 @@ namespace ICSharpCode.ILSpy.Metadata
internal class StateMachineMethodTableTreeNode : DebugMetadataTableTreeNode internal class StateMachineMethodTableTreeNode : DebugMetadataTableTreeNode
{ {
public StateMachineMethodTableTreeNode(MetadataFile metadataFile) public StateMachineMethodTableTreeNode(MetadataFile metadataFile)
: base((HandleKind)0x36, metadataFile) : base(TableIndex.StateMachineMethod, metadataFile)
{ {
} }
public override object Text => $"36 StateMachineMethod ({metadataFile.Metadata.GetTableRowCount(TableIndex.StateMachineMethod)})";
public override bool View(ViewModels.TabPageModel tabPage) public override bool View(ViewModels.TabPageModel tabPage)
{ {
tabPage.Title = Text.ToString(); tabPage.Title = Text.ToString();
@ -119,10 +116,5 @@ namespace ICSharpCode.ILSpy.Metadata
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "StateMachineMethod");
}
} }
} }

1
ILSpy/Metadata/DosHeaderTreeNode.cs

@ -88,7 +88,6 @@ namespace ICSharpCode.ILSpy.Metadata
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options) public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{ {
language.WriteCommentLine(output, "DOS Header");
} }
} }
} }

6
ILSpy/Metadata/Heaps/BlobHeapTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -77,10 +76,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.handle = handle; this.handle = handle;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Blob Heap");
}
} }
} }

6
ILSpy/Metadata/Heaps/GuidHeapTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -75,10 +74,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.handle = handle; this.handle = handle;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "Guid Heap");
}
} }
} }

6
ILSpy/Metadata/Heaps/StringHeapTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -76,10 +75,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.handle = handle; this.handle = handle;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "String Heap");
}
} }
} }

6
ILSpy/Metadata/Heaps/UserStringHeapTreeNode.cs

@ -20,7 +20,6 @@ using System.Collections.Generic;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
namespace ICSharpCode.ILSpy.Metadata namespace ICSharpCode.ILSpy.Metadata
@ -76,10 +75,5 @@ namespace ICSharpCode.ILSpy.Metadata
this.handle = handle; this.handle = handle;
} }
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
language.WriteCommentLine(output, "UserString Heap");
}
} }
} }

5
ILSpy/Metadata/MetadataHeapTreeNode.cs

@ -20,6 +20,7 @@ using System.Reflection.Metadata;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Threading; using System.Windows.Threading;
using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
@ -54,5 +55,9 @@ namespace ICSharpCode.ILSpy.Metadata
view.Loaded -= View_Loaded; view.Loaded -= View_Loaded;
this.scrollTarget = default; this.scrollTarget = default;
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
}
} }
} }

14
ILSpy/Metadata/MetadataTableTreeNode.cs

@ -34,13 +34,15 @@ namespace ICSharpCode.ILSpy.Metadata
protected readonly MetadataFile metadataFile; protected readonly MetadataFile metadataFile;
protected int scrollTarget; protected int scrollTarget;
public HandleKind Kind { get; } public TableIndex Kind { get; }
public override object Text => $"{(int)Kind:X2} {Kind} ({metadataFile.Metadata.GetTableRowCount(Kind)})";
public override object Icon => Images.MetadataTable; public override object Icon => Images.MetadataTable;
public MetadataTableTreeNode(HandleKind kind, MetadataFile metadataFile) public MetadataTableTreeNode(TableIndex table, MetadataFile metadataFile)
{ {
this.Kind = kind; this.Kind = table;
this.metadataFile = metadataFile; this.metadataFile = metadataFile;
} }
@ -130,11 +132,15 @@ namespace ICSharpCode.ILSpy.Metadata
} }
return tooltip; return tooltip;
} }
public override void Decompile(Language language, ITextOutput output, DecompilationOptions options)
{
}
} }
internal abstract class DebugMetadataTableTreeNode : MetadataTableTreeNode internal abstract class DebugMetadataTableTreeNode : MetadataTableTreeNode
{ {
public DebugMetadataTableTreeNode(HandleKind kind, MetadataFile metadataFile) public DebugMetadataTableTreeNode(TableIndex kind, MetadataFile metadataFile)
: base(kind, metadataFile) : base(kind, metadataFile)
{ {
} }

2
ILSpy/Metadata/MetadataTreeNode.cs

@ -108,7 +108,7 @@ namespace ICSharpCode.ILSpy.Metadata
public MetadataTableTreeNode FindNodeByHandleKind(HandleKind kind) public MetadataTableTreeNode FindNodeByHandleKind(HandleKind kind)
{ {
return this.Children.OfType<MetadataTablesTreeNode>().Single() return this.Children.OfType<MetadataTablesTreeNode>().Single()
.Children.OfType<MetadataTableTreeNode>().SingleOrDefault(x => x.Kind == kind); .Children.OfType<MetadataTableTreeNode>().SingleOrDefault(x => x.Kind == (TableIndex)kind);
} }
} }

Loading…
Cancel
Save