26
26
27
27
namespace ICSharpCode . ILSpy . Metadata
28
28
{
29
- class ClassLayoutTableTreeNode : MetadataTableTreeNode
29
+ internal class ClassLayoutTableTreeNode : MetadataTableTreeNode < ClassLayoutTableTreeNode . ClassLayoutEntry >
30
30
{
31
31
public ClassLayoutTableTreeNode ( MetadataFile metadataFile )
32
32
: base ( TableIndex . ClassLayout , metadataFile )
33
33
{
34
34
}
35
35
36
- public override bool View ( ViewModels . TabPageModel tabPage )
36
+ protected override IReadOnlyList < ClassLayoutEntry > LoadTable ( )
37
37
{
38
- tabPage . Title = Text . ToString ( ) ;
39
- tabPage . SupportsLanguageSwitching = false ;
40
-
41
- var view = Helpers . PrepareDataGrid ( tabPage , this ) ;
42
-
43
38
var list = new List < ClassLayoutEntry > ( ) ;
44
39
45
40
var length = metadataFile . Metadata . GetTableRowCount ( TableIndex . ClassLayout ) ;
46
41
ReadOnlySpan < byte > ptr = metadataFile . Metadata . AsReadOnlySpan ( ) ;
47
- ClassLayoutEntry scrollTargetEntry = default ;
48
42
49
43
for ( int rid = 1 ; rid <= length ; rid ++ )
50
44
{
51
- ClassLayoutEntry entry = new ClassLayoutEntry ( metadataFile , ptr , rid ) ;
52
- if ( scrollTarget == rid )
53
- {
54
- scrollTargetEntry = entry ;
55
- }
56
- list . Add ( entry ) ;
57
- }
58
-
59
- view . ItemsSource = list ;
60
- tabPage . Content = view ;
61
-
62
- if ( scrollTargetEntry . RID > 0 )
63
- {
64
- ScrollItemIntoView ( view , scrollTargetEntry ) ;
45
+ list . Add ( new ClassLayoutEntry ( metadataFile , ptr , rid ) ) ;
65
46
}
66
47
67
- return true ;
48
+ return list ;
68
49
}
69
50
70
51
readonly struct ClassLayout
@@ -81,7 +62,7 @@ public ClassLayout(ReadOnlySpan<byte> ptr, int typeDefSize)
81
62
}
82
63
}
83
64
84
- struct ClassLayoutEntry
65
+ internal struct ClassLayoutEntry
85
66
{
86
67
readonly MetadataFile metadataFile ;
87
68
readonly ClassLayout classLayout ;
0 commit comments