(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / Mono.PEToolkit / metadata / Rows.cs
blob7853f118f7c138e8c8d7ca469ef4d7e5bd75483b
1 // Auto-generated file - DO NOT EDIT!
2 // Please edit md-schema.xml or rows.xsl if you want to make changes.
4 using System;
5 using System.IO;
7 namespace Mono.PEToolkit.Metadata {
11 /// <summary>
12 /// Represents row in Module table.
13 /// </summary>
14 /// <remarks>
15 /// See Partition II, Metadata; section 21.27
16 /// </remarks>
17 public class ModuleRow : Row {
19 private MDTable table;
22 public ushort Generation;
23 public int Name;
24 public int Mvid;
25 public int EncId;
26 public int EncBaseId;
28 public ModuleRow()
32 public ModuleRow(MDTable parent)
34 table = parent;
38 /// <summary>
39 /// Row in Module table has 5 columns.
40 /// </summary>
41 public virtual int NumberOfColumns {
42 get {
43 return 5;
48 /// <summary>
49 /// Logical size of this instance in bytes.
50 /// </summary>
51 public virtual int Size {
52 get {
53 return LogicalSize;
58 /// <summary>
59 /// </summary>
60 public virtual MDTable Table {
61 get {
62 return table;
67 /// <summary>
68 /// Logical size of this type of row in bytes.
69 /// </summary>
70 unsafe public static int LogicalSize {
71 get {
72 return sizeof (ushort) + 4 + 4 + 4 + 4;
77 /// <summary>
78 /// Fills the row from the array of bytes.
79 /// </summary>
80 unsafe public void FromRawData(byte [] buff, int offs)
82 if (buff == null) throw new Exception("buff == null");
83 if (offs + Size > buff.Length) throw new Exception("bounds");
86 this.Generation = LEBitConverter.ToUInt16(buff, offs);
87 offs += sizeof (ushort);
88 this.Name = LEBitConverter.ToInt32(buff, offs);
89 offs += 4;
90 this.Mvid = LEBitConverter.ToInt32(buff, offs);
91 offs += 4;
92 this.EncId = LEBitConverter.ToInt32(buff, offs);
93 offs += 4;
94 this.EncBaseId = LEBitConverter.ToInt32(buff, offs);
100 /// <summary>
101 /// </summary>
102 public void Dump(TextWriter writer) {
103 string dump = String.Format(
104 "Generation : {0}" + Environment.NewLine +
105 "Name : {1}" + Environment.NewLine +
106 "Mvid : {2}" + Environment.NewLine +
107 "EncId : {3}" + Environment.NewLine +
108 "EncBaseId : {4}" + Environment.NewLine,
109 this.Generation,
110 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
111 "#GUID[" + Mvid.ToString() + "]",
112 "#GUID[" + EncId.ToString() + "]",
113 "#GUID[" + EncBaseId.ToString() + "]"
115 writer.WriteLine(dump);
119 /// <summary>
120 /// </summary>
121 public override string ToString()
123 StringWriter sw = new StringWriter();
124 Dump(sw);
125 return sw.ToString();
132 /// <summary>
133 /// Represents row in TypeRef table.
134 /// </summary>
135 /// <remarks>
136 /// See Partition II, Metadata; section 21.35
137 /// </remarks>
138 public class TypeRefRow : Row {
140 private MDTable table;
143 public MDToken ResolutionScope;
144 public int Name;
145 public int Namespace;
147 public TypeRefRow()
151 public TypeRefRow(MDTable parent)
153 table = parent;
157 /// <summary>
158 /// Row in TypeRef table has 3 columns.
159 /// </summary>
160 public virtual int NumberOfColumns {
161 get {
162 return 3;
167 /// <summary>
168 /// Logical size of this instance in bytes.
169 /// </summary>
170 public virtual int Size {
171 get {
172 return LogicalSize;
177 /// <summary>
178 /// </summary>
179 public virtual MDTable Table {
180 get {
181 return table;
186 /// <summary>
187 /// Logical size of this type of row in bytes.
188 /// </summary>
189 unsafe public static int LogicalSize {
190 get {
191 return 4 + 4 + 4;
196 /// <summary>
197 /// Fills the row from the array of bytes.
198 /// </summary>
199 unsafe public void FromRawData(byte [] buff, int offs)
201 if (buff == null) throw new Exception("buff == null");
202 if (offs + Size > buff.Length) throw new Exception("bounds");
205 this.ResolutionScope = TabsDecoder.DecodeToken(CodedTokenId.ResolutionScope, LEBitConverter.ToInt32(buff, offs));
206 offs += 4;
207 this.Name = LEBitConverter.ToInt32(buff, offs);
208 offs += 4;
209 this.Namespace = LEBitConverter.ToInt32(buff, offs);
215 /// <summary>
216 /// </summary>
217 public void Dump(TextWriter writer) {
218 string dump = String.Format(
219 "ResolutionScope : {0}" + Environment.NewLine +
220 "Name : {1}" + Environment.NewLine +
221 "Namespace : {2}" + Environment.NewLine,
222 this.ResolutionScope,
223 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
224 (Table == null) ? Namespace.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Namespace] + "\" (#Strings[0x" + Namespace.ToString("X") + "])"
226 writer.WriteLine(dump);
230 /// <summary>
231 /// </summary>
232 public override string ToString()
234 StringWriter sw = new StringWriter();
235 Dump(sw);
236 return sw.ToString();
243 /// <summary>
244 /// Represents row in TypeDef table.
245 /// </summary>
246 /// <remarks>
247 /// See Partition II, Metadata; section 21.34
248 /// </remarks>
249 public class TypeDefRow : Row {
251 private MDTable table;
254 public System.Reflection.TypeAttributes Flags;
255 public int Name;
256 public int Namespace;
257 public MDToken Extends;
258 public int FieldList;
259 public int MethodList;
261 public TypeDefRow()
265 public TypeDefRow(MDTable parent)
267 table = parent;
271 /// <summary>
272 /// Row in TypeDef table has 6 columns.
273 /// </summary>
274 public virtual int NumberOfColumns {
275 get {
276 return 6;
281 /// <summary>
282 /// Logical size of this instance in bytes.
283 /// </summary>
284 public virtual int Size {
285 get {
286 return LogicalSize;
291 /// <summary>
292 /// </summary>
293 public virtual MDTable Table {
294 get {
295 return table;
300 /// <summary>
301 /// Logical size of this type of row in bytes.
302 /// </summary>
303 unsafe public static int LogicalSize {
304 get {
305 return sizeof (uint) + 4 + 4 + 4 + 4 + 4;
310 /// <summary>
311 /// Fills the row from the array of bytes.
312 /// </summary>
313 unsafe public void FromRawData(byte [] buff, int offs)
315 if (buff == null) throw new Exception("buff == null");
316 if (offs + Size > buff.Length) throw new Exception("bounds");
319 this.Flags = (System.Reflection.TypeAttributes) LEBitConverter.ToUInt32(buff, offs);
320 offs += sizeof (uint);
321 this.Name = LEBitConverter.ToInt32(buff, offs);
322 offs += 4;
323 this.Namespace = LEBitConverter.ToInt32(buff, offs);
324 offs += 4;
325 this.Extends = TabsDecoder.DecodeToken(CodedTokenId.TypeDefOrRef, LEBitConverter.ToInt32(buff, offs));
326 offs += 4;
327 this.FieldList = LEBitConverter.ToInt32(buff, offs);
328 offs += 4;
329 this.MethodList = LEBitConverter.ToInt32(buff, offs);
335 /// <summary>
336 /// </summary>
337 public void Dump(TextWriter writer) {
338 string dump = String.Format(
339 "Flags : {0}" + Environment.NewLine +
340 "Name : {1}" + Environment.NewLine +
341 "Namespace : {2}" + Environment.NewLine +
342 "Extends : {3}" + Environment.NewLine +
343 "FieldList : {4}" + Environment.NewLine +
344 "MethodList : {5}" + Environment.NewLine,
345 (int)this.Flags,
346 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
347 (Table == null) ? Namespace.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Namespace] + "\" (#Strings[0x" + Namespace.ToString("X") + "])",
348 this.Extends,
349 "Field[" + FieldList.ToString() + "]",
350 "Method[" + MethodList.ToString() + "]"
352 writer.WriteLine(dump);
356 /// <summary>
357 /// </summary>
358 public override string ToString()
360 StringWriter sw = new StringWriter();
361 Dump(sw);
362 return sw.ToString();
369 /// <summary>
370 /// Represents row in FieldPtr table.
371 /// </summary>
372 /// <remarks>
373 ///
374 /// </remarks>
375 public class FieldPtrRow : Row {
377 private MDTable table;
380 public int Field;
382 public FieldPtrRow()
386 public FieldPtrRow(MDTable parent)
388 table = parent;
392 /// <summary>
393 /// Row in FieldPtr table has 1 columns.
394 /// </summary>
395 public virtual int NumberOfColumns {
396 get {
397 return 1;
402 /// <summary>
403 /// Logical size of this instance in bytes.
404 /// </summary>
405 public virtual int Size {
406 get {
407 return LogicalSize;
412 /// <summary>
413 /// </summary>
414 public virtual MDTable Table {
415 get {
416 return table;
421 /// <summary>
422 /// Logical size of this type of row in bytes.
423 /// </summary>
424 unsafe public static int LogicalSize {
425 get {
426 return 4;
431 /// <summary>
432 /// Fills the row from the array of bytes.
433 /// </summary>
434 unsafe public void FromRawData(byte [] buff, int offs)
436 if (buff == null) throw new Exception("buff == null");
437 if (offs + Size > buff.Length) throw new Exception("bounds");
440 this.Field = LEBitConverter.ToInt32(buff, offs);
446 /// <summary>
447 /// </summary>
448 public void Dump(TextWriter writer) {
449 string dump = String.Format(
450 "Field : {0}" + Environment.NewLine,
451 "Field[" + Field.ToString() + "]"
453 writer.WriteLine(dump);
457 /// <summary>
458 /// </summary>
459 public override string ToString()
461 StringWriter sw = new StringWriter();
462 Dump(sw);
463 return sw.ToString();
470 /// <summary>
471 /// Represents row in Field table.
472 /// </summary>
473 /// <remarks>
474 /// See Partition II, Metadata; section 21.15
475 /// </remarks>
476 public class FieldRow : Row {
478 private MDTable table;
481 public System.Reflection.FieldAttributes Flags;
482 public int Name;
483 public int Signature;
485 public FieldRow()
489 public FieldRow(MDTable parent)
491 table = parent;
495 /// <summary>
496 /// Row in Field table has 3 columns.
497 /// </summary>
498 public virtual int NumberOfColumns {
499 get {
500 return 3;
505 /// <summary>
506 /// Logical size of this instance in bytes.
507 /// </summary>
508 public virtual int Size {
509 get {
510 return LogicalSize;
515 /// <summary>
516 /// </summary>
517 public virtual MDTable Table {
518 get {
519 return table;
524 /// <summary>
525 /// Logical size of this type of row in bytes.
526 /// </summary>
527 unsafe public static int LogicalSize {
528 get {
529 return sizeof (ushort) + 4 + 4;
534 /// <summary>
535 /// Fills the row from the array of bytes.
536 /// </summary>
537 unsafe public void FromRawData(byte [] buff, int offs)
539 if (buff == null) throw new Exception("buff == null");
540 if (offs + Size > buff.Length) throw new Exception("bounds");
543 this.Flags = (System.Reflection.FieldAttributes) LEBitConverter.ToUInt16(buff, offs);
544 offs += sizeof (ushort);
545 this.Name = LEBitConverter.ToInt32(buff, offs);
546 offs += 4;
547 this.Signature = LEBitConverter.ToInt32(buff, offs);
553 /// <summary>
554 /// </summary>
555 public void Dump(TextWriter writer) {
556 string dump = String.Format(
557 "Flags : {0}" + Environment.NewLine +
558 "Name : {1}" + Environment.NewLine +
559 "Signature : {2}" + Environment.NewLine,
560 (int)this.Flags,
561 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
562 "#Blob[" + Signature.ToString() + "]"
564 writer.WriteLine(dump);
568 /// <summary>
569 /// </summary>
570 public override string ToString()
572 StringWriter sw = new StringWriter();
573 Dump(sw);
574 return sw.ToString();
581 /// <summary>
582 /// Represents row in MethodPtr table.
583 /// </summary>
584 /// <remarks>
585 ///
586 /// </remarks>
587 public class MethodPtrRow : Row {
589 private MDTable table;
592 public int Method;
594 public MethodPtrRow()
598 public MethodPtrRow(MDTable parent)
600 table = parent;
604 /// <summary>
605 /// Row in MethodPtr table has 1 columns.
606 /// </summary>
607 public virtual int NumberOfColumns {
608 get {
609 return 1;
614 /// <summary>
615 /// Logical size of this instance in bytes.
616 /// </summary>
617 public virtual int Size {
618 get {
619 return LogicalSize;
624 /// <summary>
625 /// </summary>
626 public virtual MDTable Table {
627 get {
628 return table;
633 /// <summary>
634 /// Logical size of this type of row in bytes.
635 /// </summary>
636 unsafe public static int LogicalSize {
637 get {
638 return 4;
643 /// <summary>
644 /// Fills the row from the array of bytes.
645 /// </summary>
646 unsafe public void FromRawData(byte [] buff, int offs)
648 if (buff == null) throw new Exception("buff == null");
649 if (offs + Size > buff.Length) throw new Exception("bounds");
652 this.Method = LEBitConverter.ToInt32(buff, offs);
658 /// <summary>
659 /// </summary>
660 public void Dump(TextWriter writer) {
661 string dump = String.Format(
662 "Method : {0}" + Environment.NewLine,
663 "Method[" + Method.ToString() + "]"
665 writer.WriteLine(dump);
669 /// <summary>
670 /// </summary>
671 public override string ToString()
673 StringWriter sw = new StringWriter();
674 Dump(sw);
675 return sw.ToString();
682 /// <summary>
683 /// Represents row in Method table.
684 /// </summary>
685 /// <remarks>
686 /// See Partition II, Metadata; section 21.24
687 /// </remarks>
688 public class MethodRow : Row {
690 private MDTable table;
693 public RVA RVA;
694 public System.Reflection.MethodImplAttributes ImplFlags;
695 public System.Reflection.MethodAttributes Flags;
696 public int Name;
697 public int Signature;
698 public int ParamList;
700 public MethodRow()
704 public MethodRow(MDTable parent)
706 table = parent;
710 /// <summary>
711 /// Row in Method table has 6 columns.
712 /// </summary>
713 public virtual int NumberOfColumns {
714 get {
715 return 6;
720 /// <summary>
721 /// Logical size of this instance in bytes.
722 /// </summary>
723 public virtual int Size {
724 get {
725 return LogicalSize;
730 /// <summary>
731 /// </summary>
732 public virtual MDTable Table {
733 get {
734 return table;
739 /// <summary>
740 /// Logical size of this type of row in bytes.
741 /// </summary>
742 unsafe public static int LogicalSize {
743 get {
744 return RVA.Size + sizeof (ushort) + sizeof (ushort) + 4 + 4 + 4;
749 /// <summary>
750 /// Fills the row from the array of bytes.
751 /// </summary>
752 unsafe public void FromRawData(byte [] buff, int offs)
754 if (buff == null) throw new Exception("buff == null");
755 if (offs + Size > buff.Length) throw new Exception("bounds");
758 this.RVA = LEBitConverter.ToUInt32(buff, offs);
759 offs += RVA.Size;
760 this.ImplFlags = (System.Reflection.MethodImplAttributes) LEBitConverter.ToUInt16(buff, offs);
761 offs += sizeof (ushort);
762 this.Flags = (System.Reflection.MethodAttributes) LEBitConverter.ToUInt16(buff, offs);
763 offs += sizeof (ushort);
764 this.Name = LEBitConverter.ToInt32(buff, offs);
765 offs += 4;
766 this.Signature = LEBitConverter.ToInt32(buff, offs);
767 offs += 4;
768 this.ParamList = LEBitConverter.ToInt32(buff, offs);
774 /// <summary>
775 /// </summary>
776 public void Dump(TextWriter writer) {
777 string dump = String.Format(
778 "RVA : {0}" + Environment.NewLine +
779 "ImplFlags : {1}" + Environment.NewLine +
780 "Flags : {2}" + Environment.NewLine +
781 "Name : {3}" + Environment.NewLine +
782 "Signature : {4}" + Environment.NewLine +
783 "ParamList : {5}" + Environment.NewLine,
784 this.RVA,
785 this.ImplFlags,
786 (int)this.Flags,
787 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
788 "#Blob[" + Signature.ToString() + "]",
789 "Param[" + ParamList.ToString() + "]"
791 writer.WriteLine(dump);
795 /// <summary>
796 /// </summary>
797 public override string ToString()
799 StringWriter sw = new StringWriter();
800 Dump(sw);
801 return sw.ToString();
808 /// <summary>
809 /// Represents row in ParamPtr table.
810 /// </summary>
811 /// <remarks>
812 ///
813 /// </remarks>
814 public class ParamPtrRow : Row {
816 private MDTable table;
819 public int Param;
821 public ParamPtrRow()
825 public ParamPtrRow(MDTable parent)
827 table = parent;
831 /// <summary>
832 /// Row in ParamPtr table has 1 columns.
833 /// </summary>
834 public virtual int NumberOfColumns {
835 get {
836 return 1;
841 /// <summary>
842 /// Logical size of this instance in bytes.
843 /// </summary>
844 public virtual int Size {
845 get {
846 return LogicalSize;
851 /// <summary>
852 /// </summary>
853 public virtual MDTable Table {
854 get {
855 return table;
860 /// <summary>
861 /// Logical size of this type of row in bytes.
862 /// </summary>
863 unsafe public static int LogicalSize {
864 get {
865 return 4;
870 /// <summary>
871 /// Fills the row from the array of bytes.
872 /// </summary>
873 unsafe public void FromRawData(byte [] buff, int offs)
875 if (buff == null) throw new Exception("buff == null");
876 if (offs + Size > buff.Length) throw new Exception("bounds");
879 this.Param = LEBitConverter.ToInt32(buff, offs);
885 /// <summary>
886 /// </summary>
887 public void Dump(TextWriter writer) {
888 string dump = String.Format(
889 "Param : {0}" + Environment.NewLine,
890 "Param[" + Param.ToString() + "]"
892 writer.WriteLine(dump);
896 /// <summary>
897 /// </summary>
898 public override string ToString()
900 StringWriter sw = new StringWriter();
901 Dump(sw);
902 return sw.ToString();
909 /// <summary>
910 /// Represents row in Param table.
911 /// </summary>
912 /// <remarks>
913 /// See Partition II, Metadata; section 21.30
914 /// </remarks>
915 public class ParamRow : Row {
917 private MDTable table;
920 public System.Reflection.ParameterAttributes Flags;
921 public ushort Sequence;
922 public int Name;
924 public ParamRow()
928 public ParamRow(MDTable parent)
930 table = parent;
934 /// <summary>
935 /// Row in Param table has 3 columns.
936 /// </summary>
937 public virtual int NumberOfColumns {
938 get {
939 return 3;
944 /// <summary>
945 /// Logical size of this instance in bytes.
946 /// </summary>
947 public virtual int Size {
948 get {
949 return LogicalSize;
954 /// <summary>
955 /// </summary>
956 public virtual MDTable Table {
957 get {
958 return table;
963 /// <summary>
964 /// Logical size of this type of row in bytes.
965 /// </summary>
966 unsafe public static int LogicalSize {
967 get {
968 return sizeof (ushort) + sizeof (ushort) + 4;
973 /// <summary>
974 /// Fills the row from the array of bytes.
975 /// </summary>
976 unsafe public void FromRawData(byte [] buff, int offs)
978 if (buff == null) throw new Exception("buff == null");
979 if (offs + Size > buff.Length) throw new Exception("bounds");
982 this.Flags = (System.Reflection.ParameterAttributes) LEBitConverter.ToUInt16(buff, offs);
983 offs += sizeof (ushort);
984 this.Sequence = LEBitConverter.ToUInt16(buff, offs);
985 offs += sizeof (ushort);
986 this.Name = LEBitConverter.ToInt32(buff, offs);
992 /// <summary>
993 /// </summary>
994 public void Dump(TextWriter writer) {
995 string dump = String.Format(
996 "Flags : {0}" + Environment.NewLine +
997 "Sequence : {1}" + Environment.NewLine +
998 "Name : {2}" + Environment.NewLine,
999 (int)this.Flags,
1000 this.Sequence,
1001 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])"
1003 writer.WriteLine(dump);
1007 /// <summary>
1008 /// </summary>
1009 public override string ToString()
1011 StringWriter sw = new StringWriter();
1012 Dump(sw);
1013 return sw.ToString();
1020 /// <summary>
1021 /// Represents row in InterfaceImpl table.
1022 /// </summary>
1023 /// <remarks>
1024 /// See Partition II, Metadata; section 21.21
1025 /// </remarks>
1026 public class InterfaceImplRow : Row {
1028 private MDTable table;
1031 public int Class;
1032 public MDToken Interface;
1034 public InterfaceImplRow()
1038 public InterfaceImplRow(MDTable parent)
1040 table = parent;
1044 /// <summary>
1045 /// Row in InterfaceImpl table has 2 columns.
1046 /// </summary>
1047 public virtual int NumberOfColumns {
1048 get {
1049 return 2;
1054 /// <summary>
1055 /// Logical size of this instance in bytes.
1056 /// </summary>
1057 public virtual int Size {
1058 get {
1059 return LogicalSize;
1064 /// <summary>
1065 /// </summary>
1066 public virtual MDTable Table {
1067 get {
1068 return table;
1073 /// <summary>
1074 /// Logical size of this type of row in bytes.
1075 /// </summary>
1076 unsafe public static int LogicalSize {
1077 get {
1078 return 4 + 4;
1083 /// <summary>
1084 /// Fills the row from the array of bytes.
1085 /// </summary>
1086 unsafe public void FromRawData(byte [] buff, int offs)
1088 if (buff == null) throw new Exception("buff == null");
1089 if (offs + Size > buff.Length) throw new Exception("bounds");
1092 this.Class = LEBitConverter.ToInt32(buff, offs);
1093 offs += 4;
1094 this.Interface = TabsDecoder.DecodeToken(CodedTokenId.TypeDefOrRef, LEBitConverter.ToInt32(buff, offs));
1100 /// <summary>
1101 /// </summary>
1102 public void Dump(TextWriter writer) {
1103 string dump = String.Format(
1104 "Class : {0}" + Environment.NewLine +
1105 "Interface : {1}" + Environment.NewLine,
1106 "TypeDef[" + Class.ToString() + "]",
1107 this.Interface
1109 writer.WriteLine(dump);
1113 /// <summary>
1114 /// </summary>
1115 public override string ToString()
1117 StringWriter sw = new StringWriter();
1118 Dump(sw);
1119 return sw.ToString();
1126 /// <summary>
1127 /// Represents row in MemberRef table.
1128 /// </summary>
1129 /// <remarks>
1130 /// See Partition II, Metadata; section 21.23
1131 /// </remarks>
1132 public class MemberRefRow : Row {
1134 private MDTable table;
1137 public MDToken Class;
1138 public int Name;
1139 public int Signature;
1141 public MemberRefRow()
1145 public MemberRefRow(MDTable parent)
1147 table = parent;
1151 /// <summary>
1152 /// Row in MemberRef table has 3 columns.
1153 /// </summary>
1154 public virtual int NumberOfColumns {
1155 get {
1156 return 3;
1161 /// <summary>
1162 /// Logical size of this instance in bytes.
1163 /// </summary>
1164 public virtual int Size {
1165 get {
1166 return LogicalSize;
1171 /// <summary>
1172 /// </summary>
1173 public virtual MDTable Table {
1174 get {
1175 return table;
1180 /// <summary>
1181 /// Logical size of this type of row in bytes.
1182 /// </summary>
1183 unsafe public static int LogicalSize {
1184 get {
1185 return 4 + 4 + 4;
1190 /// <summary>
1191 /// Fills the row from the array of bytes.
1192 /// </summary>
1193 unsafe public void FromRawData(byte [] buff, int offs)
1195 if (buff == null) throw new Exception("buff == null");
1196 if (offs + Size > buff.Length) throw new Exception("bounds");
1199 this.Class = TabsDecoder.DecodeToken(CodedTokenId.MemberRefParent, LEBitConverter.ToInt32(buff, offs));
1200 offs += 4;
1201 this.Name = LEBitConverter.ToInt32(buff, offs);
1202 offs += 4;
1203 this.Signature = LEBitConverter.ToInt32(buff, offs);
1209 /// <summary>
1210 /// </summary>
1211 public void Dump(TextWriter writer) {
1212 string dump = String.Format(
1213 "Class : {0}" + Environment.NewLine +
1214 "Name : {1}" + Environment.NewLine +
1215 "Signature : {2}" + Environment.NewLine,
1216 this.Class,
1217 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
1218 "#Blob[" + Signature.ToString() + "]"
1220 writer.WriteLine(dump);
1224 /// <summary>
1225 /// </summary>
1226 public override string ToString()
1228 StringWriter sw = new StringWriter();
1229 Dump(sw);
1230 return sw.ToString();
1237 /// <summary>
1238 /// Represents row in Constant table.
1239 /// </summary>
1240 /// <remarks>
1241 /// See Partition II, Metadata; section 21.9
1242 /// </remarks>
1243 public class ConstantRow : Row {
1245 private MDTable table;
1248 public ElementType Type;
1249 public MDToken Parent;
1250 public int Value;
1252 public ConstantRow()
1256 public ConstantRow(MDTable parent)
1258 table = parent;
1262 /// <summary>
1263 /// Row in Constant table has 3 columns.
1264 /// </summary>
1265 public virtual int NumberOfColumns {
1266 get {
1267 return 3;
1272 /// <summary>
1273 /// Logical size of this instance in bytes.
1274 /// </summary>
1275 public virtual int Size {
1276 get {
1277 return LogicalSize;
1282 /// <summary>
1283 /// </summary>
1284 public virtual MDTable Table {
1285 get {
1286 return table;
1291 /// <summary>
1292 /// Logical size of this type of row in bytes.
1293 /// </summary>
1294 unsafe public static int LogicalSize {
1295 get {
1296 return sizeof (short) + 4 + 4;
1301 /// <summary>
1302 /// Fills the row from the array of bytes.
1303 /// </summary>
1304 unsafe public void FromRawData(byte [] buff, int offs)
1306 if (buff == null) throw new Exception("buff == null");
1307 if (offs + Size > buff.Length) throw new Exception("bounds");
1310 this.Type = (ElementType) LEBitConverter.ToInt16(buff, offs);
1311 offs += sizeof (short);
1312 this.Parent = TabsDecoder.DecodeToken(CodedTokenId.HasConstant, LEBitConverter.ToInt32(buff, offs));
1313 offs += 4;
1314 this.Value = LEBitConverter.ToInt32(buff, offs);
1320 /// <summary>
1321 /// </summary>
1322 public void Dump(TextWriter writer) {
1323 string dump = String.Format(
1324 "Type : {0}" + Environment.NewLine +
1325 "Parent : {1}" + Environment.NewLine +
1326 "Value : {2}" + Environment.NewLine,
1327 this.Type,
1328 this.Parent,
1329 "#Blob[" + Value.ToString() + "]"
1331 writer.WriteLine(dump);
1335 /// <summary>
1336 /// </summary>
1337 public override string ToString()
1339 StringWriter sw = new StringWriter();
1340 Dump(sw);
1341 return sw.ToString();
1348 /// <summary>
1349 /// Represents row in CustomAttribute table.
1350 /// </summary>
1351 /// <remarks>
1352 /// See Partition II, Metadata; section 21.10
1353 /// </remarks>
1354 public class CustomAttributeRow : Row {
1356 private MDTable table;
1359 public MDToken Parent;
1360 public MDToken Type;
1361 public int Value;
1363 public CustomAttributeRow()
1367 public CustomAttributeRow(MDTable parent)
1369 table = parent;
1373 /// <summary>
1374 /// Row in CustomAttribute table has 3 columns.
1375 /// </summary>
1376 public virtual int NumberOfColumns {
1377 get {
1378 return 3;
1383 /// <summary>
1384 /// Logical size of this instance in bytes.
1385 /// </summary>
1386 public virtual int Size {
1387 get {
1388 return LogicalSize;
1393 /// <summary>
1394 /// </summary>
1395 public virtual MDTable Table {
1396 get {
1397 return table;
1402 /// <summary>
1403 /// Logical size of this type of row in bytes.
1404 /// </summary>
1405 unsafe public static int LogicalSize {
1406 get {
1407 return 4 + 4 + 4;
1412 /// <summary>
1413 /// Fills the row from the array of bytes.
1414 /// </summary>
1415 unsafe public void FromRawData(byte [] buff, int offs)
1417 if (buff == null) throw new Exception("buff == null");
1418 if (offs + Size > buff.Length) throw new Exception("bounds");
1421 this.Parent = TabsDecoder.DecodeToken(CodedTokenId.HasCustomAttribute, LEBitConverter.ToInt32(buff, offs));
1422 offs += 4;
1423 this.Type = TabsDecoder.DecodeToken(CodedTokenId.CustomAttributeType, LEBitConverter.ToInt32(buff, offs));
1424 offs += 4;
1425 this.Value = LEBitConverter.ToInt32(buff, offs);
1431 /// <summary>
1432 /// </summary>
1433 public void Dump(TextWriter writer) {
1434 string dump = String.Format(
1435 "Parent : {0}" + Environment.NewLine +
1436 "Type : {1}" + Environment.NewLine +
1437 "Value : {2}" + Environment.NewLine,
1438 this.Parent,
1439 this.Type,
1440 "#Blob[" + Value.ToString() + "]"
1442 writer.WriteLine(dump);
1446 /// <summary>
1447 /// </summary>
1448 public override string ToString()
1450 StringWriter sw = new StringWriter();
1451 Dump(sw);
1452 return sw.ToString();
1459 /// <summary>
1460 /// Represents row in FieldMarshal table.
1461 /// </summary>
1462 /// <remarks>
1463 /// See Partition II, Metadata; section 21.17
1464 /// </remarks>
1465 public class FieldMarshalRow : Row {
1467 private MDTable table;
1470 public MDToken Parent;
1471 public int NativeType;
1473 public FieldMarshalRow()
1477 public FieldMarshalRow(MDTable parent)
1479 table = parent;
1483 /// <summary>
1484 /// Row in FieldMarshal table has 2 columns.
1485 /// </summary>
1486 public virtual int NumberOfColumns {
1487 get {
1488 return 2;
1493 /// <summary>
1494 /// Logical size of this instance in bytes.
1495 /// </summary>
1496 public virtual int Size {
1497 get {
1498 return LogicalSize;
1503 /// <summary>
1504 /// </summary>
1505 public virtual MDTable Table {
1506 get {
1507 return table;
1512 /// <summary>
1513 /// Logical size of this type of row in bytes.
1514 /// </summary>
1515 unsafe public static int LogicalSize {
1516 get {
1517 return 4 + 4;
1522 /// <summary>
1523 /// Fills the row from the array of bytes.
1524 /// </summary>
1525 unsafe public void FromRawData(byte [] buff, int offs)
1527 if (buff == null) throw new Exception("buff == null");
1528 if (offs + Size > buff.Length) throw new Exception("bounds");
1531 this.Parent = TabsDecoder.DecodeToken(CodedTokenId.HasFieldMarshal, LEBitConverter.ToInt32(buff, offs));
1532 offs += 4;
1533 this.NativeType = LEBitConverter.ToInt32(buff, offs);
1539 /// <summary>
1540 /// </summary>
1541 public void Dump(TextWriter writer) {
1542 string dump = String.Format(
1543 "Parent : {0}" + Environment.NewLine +
1544 "NativeType : {1}" + Environment.NewLine,
1545 this.Parent,
1546 "#Blob[" + NativeType.ToString() + "]"
1548 writer.WriteLine(dump);
1552 /// <summary>
1553 /// </summary>
1554 public override string ToString()
1556 StringWriter sw = new StringWriter();
1557 Dump(sw);
1558 return sw.ToString();
1565 /// <summary>
1566 /// Represents row in DeclSecurity table.
1567 /// </summary>
1568 /// <remarks>
1569 /// See Partition II, Metadata; section 21.11
1570 /// </remarks>
1571 public class DeclSecurityRow : Row {
1573 private MDTable table;
1576 public short Action;
1577 public MDToken Parent;
1578 public int PermissionSet;
1580 public DeclSecurityRow()
1584 public DeclSecurityRow(MDTable parent)
1586 table = parent;
1590 /// <summary>
1591 /// Row in DeclSecurity table has 3 columns.
1592 /// </summary>
1593 public virtual int NumberOfColumns {
1594 get {
1595 return 3;
1600 /// <summary>
1601 /// Logical size of this instance in bytes.
1602 /// </summary>
1603 public virtual int Size {
1604 get {
1605 return LogicalSize;
1610 /// <summary>
1611 /// </summary>
1612 public virtual MDTable Table {
1613 get {
1614 return table;
1619 /// <summary>
1620 /// Logical size of this type of row in bytes.
1621 /// </summary>
1622 unsafe public static int LogicalSize {
1623 get {
1624 return sizeof (short) + 4 + 4;
1629 /// <summary>
1630 /// Fills the row from the array of bytes.
1631 /// </summary>
1632 unsafe public void FromRawData(byte [] buff, int offs)
1634 if (buff == null) throw new Exception("buff == null");
1635 if (offs + Size > buff.Length) throw new Exception("bounds");
1638 this.Action = LEBitConverter.ToInt16(buff, offs);
1639 offs += sizeof (short);
1640 this.Parent = TabsDecoder.DecodeToken(CodedTokenId.HasDeclSecurity, LEBitConverter.ToInt32(buff, offs));
1641 offs += 4;
1642 this.PermissionSet = LEBitConverter.ToInt32(buff, offs);
1648 /// <summary>
1649 /// </summary>
1650 public void Dump(TextWriter writer) {
1651 string dump = String.Format(
1652 "Action : {0}" + Environment.NewLine +
1653 "Parent : {1}" + Environment.NewLine +
1654 "PermissionSet : {2}" + Environment.NewLine,
1655 this.Action,
1656 this.Parent,
1657 "#Blob[" + PermissionSet.ToString() + "]"
1659 writer.WriteLine(dump);
1663 /// <summary>
1664 /// </summary>
1665 public override string ToString()
1667 StringWriter sw = new StringWriter();
1668 Dump(sw);
1669 return sw.ToString();
1676 /// <summary>
1677 /// Represents row in ClassLayout table.
1678 /// </summary>
1679 /// <remarks>
1680 /// See Partition II, Metadata; section 21.8
1681 /// </remarks>
1682 public class ClassLayoutRow : Row {
1684 private MDTable table;
1687 public short PackingSize;
1688 public int ClassSize;
1689 public int Parent;
1691 public ClassLayoutRow()
1695 public ClassLayoutRow(MDTable parent)
1697 table = parent;
1701 /// <summary>
1702 /// Row in ClassLayout table has 3 columns.
1703 /// </summary>
1704 public virtual int NumberOfColumns {
1705 get {
1706 return 3;
1711 /// <summary>
1712 /// Logical size of this instance in bytes.
1713 /// </summary>
1714 public virtual int Size {
1715 get {
1716 return LogicalSize;
1721 /// <summary>
1722 /// </summary>
1723 public virtual MDTable Table {
1724 get {
1725 return table;
1730 /// <summary>
1731 /// Logical size of this type of row in bytes.
1732 /// </summary>
1733 unsafe public static int LogicalSize {
1734 get {
1735 return sizeof (short) + sizeof (int) + 4;
1740 /// <summary>
1741 /// Fills the row from the array of bytes.
1742 /// </summary>
1743 unsafe public void FromRawData(byte [] buff, int offs)
1745 if (buff == null) throw new Exception("buff == null");
1746 if (offs + Size > buff.Length) throw new Exception("bounds");
1749 this.PackingSize = LEBitConverter.ToInt16(buff, offs);
1750 offs += sizeof (short);
1751 this.ClassSize = LEBitConverter.ToInt32(buff, offs);
1752 offs += sizeof (int);
1753 this.Parent = LEBitConverter.ToInt32(buff, offs);
1759 /// <summary>
1760 /// </summary>
1761 public void Dump(TextWriter writer) {
1762 string dump = String.Format(
1763 "PackingSize : {0}" + Environment.NewLine +
1764 "ClassSize : {1}" + Environment.NewLine +
1765 "Parent : {2}" + Environment.NewLine,
1766 this.PackingSize,
1767 this.ClassSize,
1768 "TypeDef[" + Parent.ToString() + "]"
1770 writer.WriteLine(dump);
1774 /// <summary>
1775 /// </summary>
1776 public override string ToString()
1778 StringWriter sw = new StringWriter();
1779 Dump(sw);
1780 return sw.ToString();
1787 /// <summary>
1788 /// Represents row in FieldLayout table.
1789 /// </summary>
1790 /// <remarks>
1791 /// See Partition II, Metadata; section 21.16
1792 /// </remarks>
1793 public class FieldLayoutRow : Row {
1795 private MDTable table;
1798 public int Offset;
1799 public int Field;
1801 public FieldLayoutRow()
1805 public FieldLayoutRow(MDTable parent)
1807 table = parent;
1811 /// <summary>
1812 /// Row in FieldLayout table has 2 columns.
1813 /// </summary>
1814 public virtual int NumberOfColumns {
1815 get {
1816 return 2;
1821 /// <summary>
1822 /// Logical size of this instance in bytes.
1823 /// </summary>
1824 public virtual int Size {
1825 get {
1826 return LogicalSize;
1831 /// <summary>
1832 /// </summary>
1833 public virtual MDTable Table {
1834 get {
1835 return table;
1840 /// <summary>
1841 /// Logical size of this type of row in bytes.
1842 /// </summary>
1843 unsafe public static int LogicalSize {
1844 get {
1845 return sizeof (int) + 4;
1850 /// <summary>
1851 /// Fills the row from the array of bytes.
1852 /// </summary>
1853 unsafe public void FromRawData(byte [] buff, int offs)
1855 if (buff == null) throw new Exception("buff == null");
1856 if (offs + Size > buff.Length) throw new Exception("bounds");
1859 this.Offset = LEBitConverter.ToInt32(buff, offs);
1860 offs += sizeof (int);
1861 this.Field = LEBitConverter.ToInt32(buff, offs);
1867 /// <summary>
1868 /// </summary>
1869 public void Dump(TextWriter writer) {
1870 string dump = String.Format(
1871 "Offset : {0}" + Environment.NewLine +
1872 "Field : {1}" + Environment.NewLine,
1873 this.Offset,
1874 "Field[" + Field.ToString() + "]"
1876 writer.WriteLine(dump);
1880 /// <summary>
1881 /// </summary>
1882 public override string ToString()
1884 StringWriter sw = new StringWriter();
1885 Dump(sw);
1886 return sw.ToString();
1893 /// <summary>
1894 /// Represents row in StandAloneSig table.
1895 /// </summary>
1896 /// <remarks>
1897 /// See Partition II, Metadata; section 21.33
1898 /// </remarks>
1899 public class StandAloneSigRow : Row {
1901 private MDTable table;
1904 public int Signature;
1906 public StandAloneSigRow()
1910 public StandAloneSigRow(MDTable parent)
1912 table = parent;
1916 /// <summary>
1917 /// Row in StandAloneSig table has 1 columns.
1918 /// </summary>
1919 public virtual int NumberOfColumns {
1920 get {
1921 return 1;
1926 /// <summary>
1927 /// Logical size of this instance in bytes.
1928 /// </summary>
1929 public virtual int Size {
1930 get {
1931 return LogicalSize;
1936 /// <summary>
1937 /// </summary>
1938 public virtual MDTable Table {
1939 get {
1940 return table;
1945 /// <summary>
1946 /// Logical size of this type of row in bytes.
1947 /// </summary>
1948 unsafe public static int LogicalSize {
1949 get {
1950 return 4;
1955 /// <summary>
1956 /// Fills the row from the array of bytes.
1957 /// </summary>
1958 unsafe public void FromRawData(byte [] buff, int offs)
1960 if (buff == null) throw new Exception("buff == null");
1961 if (offs + Size > buff.Length) throw new Exception("bounds");
1964 this.Signature = LEBitConverter.ToInt32(buff, offs);
1970 /// <summary>
1971 /// </summary>
1972 public void Dump(TextWriter writer) {
1973 string dump = String.Format(
1974 "Signature : {0}" + Environment.NewLine,
1975 "#Blob[" + Signature.ToString() + "]"
1977 writer.WriteLine(dump);
1981 /// <summary>
1982 /// </summary>
1983 public override string ToString()
1985 StringWriter sw = new StringWriter();
1986 Dump(sw);
1987 return sw.ToString();
1994 /// <summary>
1995 /// Represents row in EventMap table.
1996 /// </summary>
1997 /// <remarks>
1998 /// See Partition II, Metadata; section 21.12
1999 /// </remarks>
2000 public class EventMapRow : Row {
2002 private MDTable table;
2005 public int Parent;
2006 public int EventList;
2008 public EventMapRow()
2012 public EventMapRow(MDTable parent)
2014 table = parent;
2018 /// <summary>
2019 /// Row in EventMap table has 2 columns.
2020 /// </summary>
2021 public virtual int NumberOfColumns {
2022 get {
2023 return 2;
2028 /// <summary>
2029 /// Logical size of this instance in bytes.
2030 /// </summary>
2031 public virtual int Size {
2032 get {
2033 return LogicalSize;
2038 /// <summary>
2039 /// </summary>
2040 public virtual MDTable Table {
2041 get {
2042 return table;
2047 /// <summary>
2048 /// Logical size of this type of row in bytes.
2049 /// </summary>
2050 unsafe public static int LogicalSize {
2051 get {
2052 return 4 + 4;
2057 /// <summary>
2058 /// Fills the row from the array of bytes.
2059 /// </summary>
2060 unsafe public void FromRawData(byte [] buff, int offs)
2062 if (buff == null) throw new Exception("buff == null");
2063 if (offs + Size > buff.Length) throw new Exception("bounds");
2066 this.Parent = LEBitConverter.ToInt32(buff, offs);
2067 offs += 4;
2068 this.EventList = LEBitConverter.ToInt32(buff, offs);
2074 /// <summary>
2075 /// </summary>
2076 public void Dump(TextWriter writer) {
2077 string dump = String.Format(
2078 "Parent : {0}" + Environment.NewLine +
2079 "EventList : {1}" + Environment.NewLine,
2080 "TypeDef[" + Parent.ToString() + "]",
2081 "Event[" + EventList.ToString() + "]"
2083 writer.WriteLine(dump);
2087 /// <summary>
2088 /// </summary>
2089 public override string ToString()
2091 StringWriter sw = new StringWriter();
2092 Dump(sw);
2093 return sw.ToString();
2100 /// <summary>
2101 /// Represents row in EventPtr table.
2102 /// </summary>
2103 /// <remarks>
2104 ///
2105 /// </remarks>
2106 public class EventPtrRow : Row {
2108 private MDTable table;
2111 public int Event;
2113 public EventPtrRow()
2117 public EventPtrRow(MDTable parent)
2119 table = parent;
2123 /// <summary>
2124 /// Row in EventPtr table has 1 columns.
2125 /// </summary>
2126 public virtual int NumberOfColumns {
2127 get {
2128 return 1;
2133 /// <summary>
2134 /// Logical size of this instance in bytes.
2135 /// </summary>
2136 public virtual int Size {
2137 get {
2138 return LogicalSize;
2143 /// <summary>
2144 /// </summary>
2145 public virtual MDTable Table {
2146 get {
2147 return table;
2152 /// <summary>
2153 /// Logical size of this type of row in bytes.
2154 /// </summary>
2155 unsafe public static int LogicalSize {
2156 get {
2157 return 4;
2162 /// <summary>
2163 /// Fills the row from the array of bytes.
2164 /// </summary>
2165 unsafe public void FromRawData(byte [] buff, int offs)
2167 if (buff == null) throw new Exception("buff == null");
2168 if (offs + Size > buff.Length) throw new Exception("bounds");
2171 this.Event = LEBitConverter.ToInt32(buff, offs);
2177 /// <summary>
2178 /// </summary>
2179 public void Dump(TextWriter writer) {
2180 string dump = String.Format(
2181 "Event : {0}" + Environment.NewLine,
2182 "Event[" + Event.ToString() + "]"
2184 writer.WriteLine(dump);
2188 /// <summary>
2189 /// </summary>
2190 public override string ToString()
2192 StringWriter sw = new StringWriter();
2193 Dump(sw);
2194 return sw.ToString();
2201 /// <summary>
2202 /// Represents row in Event table.
2203 /// </summary>
2204 /// <remarks>
2205 /// See Partition II, Metadata; section 21.13
2206 /// </remarks>
2207 public class EventRow : Row {
2209 private MDTable table;
2212 public System.Reflection.EventAttributes EventFlags;
2213 public int Name;
2214 public MDToken EventType;
2216 public EventRow()
2220 public EventRow(MDTable parent)
2222 table = parent;
2226 /// <summary>
2227 /// Row in Event table has 3 columns.
2228 /// </summary>
2229 public virtual int NumberOfColumns {
2230 get {
2231 return 3;
2236 /// <summary>
2237 /// Logical size of this instance in bytes.
2238 /// </summary>
2239 public virtual int Size {
2240 get {
2241 return LogicalSize;
2246 /// <summary>
2247 /// </summary>
2248 public virtual MDTable Table {
2249 get {
2250 return table;
2255 /// <summary>
2256 /// Logical size of this type of row in bytes.
2257 /// </summary>
2258 unsafe public static int LogicalSize {
2259 get {
2260 return sizeof (short) + 4 + 4;
2265 /// <summary>
2266 /// Fills the row from the array of bytes.
2267 /// </summary>
2268 unsafe public void FromRawData(byte [] buff, int offs)
2270 if (buff == null) throw new Exception("buff == null");
2271 if (offs + Size > buff.Length) throw new Exception("bounds");
2274 this.EventFlags = (System.Reflection.EventAttributes) LEBitConverter.ToInt16(buff, offs);
2275 offs += sizeof (short);
2276 this.Name = LEBitConverter.ToInt32(buff, offs);
2277 offs += 4;
2278 this.EventType = TabsDecoder.DecodeToken(CodedTokenId.TypeDefOrRef, LEBitConverter.ToInt32(buff, offs));
2284 /// <summary>
2285 /// </summary>
2286 public void Dump(TextWriter writer) {
2287 string dump = String.Format(
2288 "EventFlags : {0}" + Environment.NewLine +
2289 "Name : {1}" + Environment.NewLine +
2290 "EventType : {2}" + Environment.NewLine,
2291 this.EventFlags,
2292 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
2293 this.EventType
2295 writer.WriteLine(dump);
2299 /// <summary>
2300 /// </summary>
2301 public override string ToString()
2303 StringWriter sw = new StringWriter();
2304 Dump(sw);
2305 return sw.ToString();
2312 /// <summary>
2313 /// Represents row in PropertyMap table.
2314 /// </summary>
2315 /// <remarks>
2316 /// See Partition II, Metadata; section 21.32
2317 /// </remarks>
2318 public class PropertyMapRow : Row {
2320 private MDTable table;
2323 public int Parent;
2324 public int PropertyList;
2326 public PropertyMapRow()
2330 public PropertyMapRow(MDTable parent)
2332 table = parent;
2336 /// <summary>
2337 /// Row in PropertyMap table has 2 columns.
2338 /// </summary>
2339 public virtual int NumberOfColumns {
2340 get {
2341 return 2;
2346 /// <summary>
2347 /// Logical size of this instance in bytes.
2348 /// </summary>
2349 public virtual int Size {
2350 get {
2351 return LogicalSize;
2356 /// <summary>
2357 /// </summary>
2358 public virtual MDTable Table {
2359 get {
2360 return table;
2365 /// <summary>
2366 /// Logical size of this type of row in bytes.
2367 /// </summary>
2368 unsafe public static int LogicalSize {
2369 get {
2370 return 4 + 4;
2375 /// <summary>
2376 /// Fills the row from the array of bytes.
2377 /// </summary>
2378 unsafe public void FromRawData(byte [] buff, int offs)
2380 if (buff == null) throw new Exception("buff == null");
2381 if (offs + Size > buff.Length) throw new Exception("bounds");
2384 this.Parent = LEBitConverter.ToInt32(buff, offs);
2385 offs += 4;
2386 this.PropertyList = LEBitConverter.ToInt32(buff, offs);
2392 /// <summary>
2393 /// </summary>
2394 public void Dump(TextWriter writer) {
2395 string dump = String.Format(
2396 "Parent : {0}" + Environment.NewLine +
2397 "PropertyList : {1}" + Environment.NewLine,
2398 "TypeDef[" + Parent.ToString() + "]",
2399 "Property[" + PropertyList.ToString() + "]"
2401 writer.WriteLine(dump);
2405 /// <summary>
2406 /// </summary>
2407 public override string ToString()
2409 StringWriter sw = new StringWriter();
2410 Dump(sw);
2411 return sw.ToString();
2418 /// <summary>
2419 /// Represents row in PropertyPtr table.
2420 /// </summary>
2421 /// <remarks>
2422 ///
2423 /// </remarks>
2424 public class PropertyPtrRow : Row {
2426 private MDTable table;
2429 public int Property;
2431 public PropertyPtrRow()
2435 public PropertyPtrRow(MDTable parent)
2437 table = parent;
2441 /// <summary>
2442 /// Row in PropertyPtr table has 1 columns.
2443 /// </summary>
2444 public virtual int NumberOfColumns {
2445 get {
2446 return 1;
2451 /// <summary>
2452 /// Logical size of this instance in bytes.
2453 /// </summary>
2454 public virtual int Size {
2455 get {
2456 return LogicalSize;
2461 /// <summary>
2462 /// </summary>
2463 public virtual MDTable Table {
2464 get {
2465 return table;
2470 /// <summary>
2471 /// Logical size of this type of row in bytes.
2472 /// </summary>
2473 unsafe public static int LogicalSize {
2474 get {
2475 return 4;
2480 /// <summary>
2481 /// Fills the row from the array of bytes.
2482 /// </summary>
2483 unsafe public void FromRawData(byte [] buff, int offs)
2485 if (buff == null) throw new Exception("buff == null");
2486 if (offs + Size > buff.Length) throw new Exception("bounds");
2489 this.Property = LEBitConverter.ToInt32(buff, offs);
2495 /// <summary>
2496 /// </summary>
2497 public void Dump(TextWriter writer) {
2498 string dump = String.Format(
2499 "Property : {0}" + Environment.NewLine,
2500 "Property[" + Property.ToString() + "]"
2502 writer.WriteLine(dump);
2506 /// <summary>
2507 /// </summary>
2508 public override string ToString()
2510 StringWriter sw = new StringWriter();
2511 Dump(sw);
2512 return sw.ToString();
2519 /// <summary>
2520 /// Represents row in Property table.
2521 /// </summary>
2522 /// <remarks>
2523 /// See Partition II, Metadata; section 21.30
2524 /// </remarks>
2525 public class PropertyRow : Row {
2527 private MDTable table;
2530 public System.Reflection.PropertyAttributes Flags;
2531 public int Name;
2532 public int Type;
2534 public PropertyRow()
2538 public PropertyRow(MDTable parent)
2540 table = parent;
2544 /// <summary>
2545 /// Row in Property table has 3 columns.
2546 /// </summary>
2547 public virtual int NumberOfColumns {
2548 get {
2549 return 3;
2554 /// <summary>
2555 /// Logical size of this instance in bytes.
2556 /// </summary>
2557 public virtual int Size {
2558 get {
2559 return LogicalSize;
2564 /// <summary>
2565 /// </summary>
2566 public virtual MDTable Table {
2567 get {
2568 return table;
2573 /// <summary>
2574 /// Logical size of this type of row in bytes.
2575 /// </summary>
2576 unsafe public static int LogicalSize {
2577 get {
2578 return sizeof (ushort) + 4 + 4;
2583 /// <summary>
2584 /// Fills the row from the array of bytes.
2585 /// </summary>
2586 unsafe public void FromRawData(byte [] buff, int offs)
2588 if (buff == null) throw new Exception("buff == null");
2589 if (offs + Size > buff.Length) throw new Exception("bounds");
2592 this.Flags = (System.Reflection.PropertyAttributes) LEBitConverter.ToUInt16(buff, offs);
2593 offs += sizeof (ushort);
2594 this.Name = LEBitConverter.ToInt32(buff, offs);
2595 offs += 4;
2596 this.Type = LEBitConverter.ToInt32(buff, offs);
2602 /// <summary>
2603 /// </summary>
2604 public void Dump(TextWriter writer) {
2605 string dump = String.Format(
2606 "Flags : {0}" + Environment.NewLine +
2607 "Name : {1}" + Environment.NewLine +
2608 "Type : {2}" + Environment.NewLine,
2609 (int)this.Flags,
2610 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
2611 "#Blob[" + Type.ToString() + "]"
2613 writer.WriteLine(dump);
2617 /// <summary>
2618 /// </summary>
2619 public override string ToString()
2621 StringWriter sw = new StringWriter();
2622 Dump(sw);
2623 return sw.ToString();
2630 /// <summary>
2631 /// Represents row in MethodSemantics table.
2632 /// </summary>
2633 /// <remarks>
2634 /// See Partition II, Metadata; section 21.26
2635 /// </remarks>
2636 public class MethodSemanticsRow : Row {
2638 private MDTable table;
2641 public MethodSemanticsAttributes Semantics;
2642 public int Method;
2643 public MDToken Association;
2645 public MethodSemanticsRow()
2649 public MethodSemanticsRow(MDTable parent)
2651 table = parent;
2655 /// <summary>
2656 /// Row in MethodSemantics table has 3 columns.
2657 /// </summary>
2658 public virtual int NumberOfColumns {
2659 get {
2660 return 3;
2665 /// <summary>
2666 /// Logical size of this instance in bytes.
2667 /// </summary>
2668 public virtual int Size {
2669 get {
2670 return LogicalSize;
2675 /// <summary>
2676 /// </summary>
2677 public virtual MDTable Table {
2678 get {
2679 return table;
2684 /// <summary>
2685 /// Logical size of this type of row in bytes.
2686 /// </summary>
2687 unsafe public static int LogicalSize {
2688 get {
2689 return sizeof (ushort) + 4 + 4;
2694 /// <summary>
2695 /// Fills the row from the array of bytes.
2696 /// </summary>
2697 unsafe public void FromRawData(byte [] buff, int offs)
2699 if (buff == null) throw new Exception("buff == null");
2700 if (offs + Size > buff.Length) throw new Exception("bounds");
2703 this.Semantics = (MethodSemanticsAttributes) LEBitConverter.ToUInt16(buff, offs);
2704 offs += sizeof (ushort);
2705 this.Method = LEBitConverter.ToInt32(buff, offs);
2706 offs += 4;
2707 this.Association = TabsDecoder.DecodeToken(CodedTokenId.HasSemantics, LEBitConverter.ToInt32(buff, offs));
2713 /// <summary>
2714 /// </summary>
2715 public void Dump(TextWriter writer) {
2716 string dump = String.Format(
2717 "Semantics : {0}" + Environment.NewLine +
2718 "Method : {1}" + Environment.NewLine +
2719 "Association : {2}" + Environment.NewLine,
2720 (int)this.Semantics,
2721 "Method[" + Method.ToString() + "]",
2722 this.Association
2724 writer.WriteLine(dump);
2728 /// <summary>
2729 /// </summary>
2730 public override string ToString()
2732 StringWriter sw = new StringWriter();
2733 Dump(sw);
2734 return sw.ToString();
2741 /// <summary>
2742 /// Represents row in MethodImpl table.
2743 /// </summary>
2744 /// <remarks>
2745 /// See Partition II, Metadata; section 21.25
2746 /// </remarks>
2747 public class MethodImplRow : Row {
2749 private MDTable table;
2752 public int Class;
2753 public MDToken MethodBody;
2754 public MDToken MethodDeclaration;
2756 public MethodImplRow()
2760 public MethodImplRow(MDTable parent)
2762 table = parent;
2766 /// <summary>
2767 /// Row in MethodImpl table has 3 columns.
2768 /// </summary>
2769 public virtual int NumberOfColumns {
2770 get {
2771 return 3;
2776 /// <summary>
2777 /// Logical size of this instance in bytes.
2778 /// </summary>
2779 public virtual int Size {
2780 get {
2781 return LogicalSize;
2786 /// <summary>
2787 /// </summary>
2788 public virtual MDTable Table {
2789 get {
2790 return table;
2795 /// <summary>
2796 /// Logical size of this type of row in bytes.
2797 /// </summary>
2798 unsafe public static int LogicalSize {
2799 get {
2800 return 4 + 4 + 4;
2805 /// <summary>
2806 /// Fills the row from the array of bytes.
2807 /// </summary>
2808 unsafe public void FromRawData(byte [] buff, int offs)
2810 if (buff == null) throw new Exception("buff == null");
2811 if (offs + Size > buff.Length) throw new Exception("bounds");
2814 this.Class = LEBitConverter.ToInt32(buff, offs);
2815 offs += 4;
2816 this.MethodBody = TabsDecoder.DecodeToken(CodedTokenId.MethodDefOrRef, LEBitConverter.ToInt32(buff, offs));
2817 offs += 4;
2818 this.MethodDeclaration = TabsDecoder.DecodeToken(CodedTokenId.MethodDefOrRef, LEBitConverter.ToInt32(buff, offs));
2824 /// <summary>
2825 /// </summary>
2826 public void Dump(TextWriter writer) {
2827 string dump = String.Format(
2828 "Class : {0}" + Environment.NewLine +
2829 "MethodBody : {1}" + Environment.NewLine +
2830 "MethodDeclaration : {2}" + Environment.NewLine,
2831 "TypeDef[" + Class.ToString() + "]",
2832 this.MethodBody,
2833 this.MethodDeclaration
2835 writer.WriteLine(dump);
2839 /// <summary>
2840 /// </summary>
2841 public override string ToString()
2843 StringWriter sw = new StringWriter();
2844 Dump(sw);
2845 return sw.ToString();
2852 /// <summary>
2853 /// Represents row in ModuleRef table.
2854 /// </summary>
2855 /// <remarks>
2856 /// See Partition II, Metadata; section 21.28
2857 /// </remarks>
2858 public class ModuleRefRow : Row {
2860 private MDTable table;
2863 public int Name;
2865 public ModuleRefRow()
2869 public ModuleRefRow(MDTable parent)
2871 table = parent;
2875 /// <summary>
2876 /// Row in ModuleRef table has 1 columns.
2877 /// </summary>
2878 public virtual int NumberOfColumns {
2879 get {
2880 return 1;
2885 /// <summary>
2886 /// Logical size of this instance in bytes.
2887 /// </summary>
2888 public virtual int Size {
2889 get {
2890 return LogicalSize;
2895 /// <summary>
2896 /// </summary>
2897 public virtual MDTable Table {
2898 get {
2899 return table;
2904 /// <summary>
2905 /// Logical size of this type of row in bytes.
2906 /// </summary>
2907 unsafe public static int LogicalSize {
2908 get {
2909 return 4;
2914 /// <summary>
2915 /// Fills the row from the array of bytes.
2916 /// </summary>
2917 unsafe public void FromRawData(byte [] buff, int offs)
2919 if (buff == null) throw new Exception("buff == null");
2920 if (offs + Size > buff.Length) throw new Exception("bounds");
2923 this.Name = LEBitConverter.ToInt32(buff, offs);
2929 /// <summary>
2930 /// </summary>
2931 public void Dump(TextWriter writer) {
2932 string dump = String.Format(
2933 "Name : {0}" + Environment.NewLine,
2934 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])"
2936 writer.WriteLine(dump);
2940 /// <summary>
2941 /// </summary>
2942 public override string ToString()
2944 StringWriter sw = new StringWriter();
2945 Dump(sw);
2946 return sw.ToString();
2953 /// <summary>
2954 /// Represents row in TypeSpec table.
2955 /// </summary>
2956 /// <remarks>
2957 /// See Partition II, Metadata; section 21.36
2958 /// </remarks>
2959 public class TypeSpecRow : Row {
2961 private MDTable table;
2964 public int Signature;
2966 public TypeSpecRow()
2970 public TypeSpecRow(MDTable parent)
2972 table = parent;
2976 /// <summary>
2977 /// Row in TypeSpec table has 1 columns.
2978 /// </summary>
2979 public virtual int NumberOfColumns {
2980 get {
2981 return 1;
2986 /// <summary>
2987 /// Logical size of this instance in bytes.
2988 /// </summary>
2989 public virtual int Size {
2990 get {
2991 return LogicalSize;
2996 /// <summary>
2997 /// </summary>
2998 public virtual MDTable Table {
2999 get {
3000 return table;
3005 /// <summary>
3006 /// Logical size of this type of row in bytes.
3007 /// </summary>
3008 unsafe public static int LogicalSize {
3009 get {
3010 return 4;
3015 /// <summary>
3016 /// Fills the row from the array of bytes.
3017 /// </summary>
3018 unsafe public void FromRawData(byte [] buff, int offs)
3020 if (buff == null) throw new Exception("buff == null");
3021 if (offs + Size > buff.Length) throw new Exception("bounds");
3024 this.Signature = LEBitConverter.ToInt32(buff, offs);
3030 /// <summary>
3031 /// </summary>
3032 public void Dump(TextWriter writer) {
3033 string dump = String.Format(
3034 "Signature : {0}" + Environment.NewLine,
3035 "#Blob[" + Signature.ToString() + "]"
3037 writer.WriteLine(dump);
3041 /// <summary>
3042 /// </summary>
3043 public override string ToString()
3045 StringWriter sw = new StringWriter();
3046 Dump(sw);
3047 return sw.ToString();
3054 /// <summary>
3055 /// Represents row in ImplMap table.
3056 /// </summary>
3057 /// <remarks>
3058 /// See Partition II, Metadata; section 21.20
3059 /// </remarks>
3060 public class ImplMapRow : Row {
3062 private MDTable table;
3065 public PInvokeAttributes MappingFlags;
3066 public MDToken MemberForwarded;
3067 public int ImportName;
3068 public int ImportScope;
3070 public ImplMapRow()
3074 public ImplMapRow(MDTable parent)
3076 table = parent;
3080 /// <summary>
3081 /// Row in ImplMap table has 4 columns.
3082 /// </summary>
3083 public virtual int NumberOfColumns {
3084 get {
3085 return 4;
3090 /// <summary>
3091 /// Logical size of this instance in bytes.
3092 /// </summary>
3093 public virtual int Size {
3094 get {
3095 return LogicalSize;
3100 /// <summary>
3101 /// </summary>
3102 public virtual MDTable Table {
3103 get {
3104 return table;
3109 /// <summary>
3110 /// Logical size of this type of row in bytes.
3111 /// </summary>
3112 unsafe public static int LogicalSize {
3113 get {
3114 return sizeof (ushort) + 4 + 4 + 4;
3119 /// <summary>
3120 /// Fills the row from the array of bytes.
3121 /// </summary>
3122 unsafe public void FromRawData(byte [] buff, int offs)
3124 if (buff == null) throw new Exception("buff == null");
3125 if (offs + Size > buff.Length) throw new Exception("bounds");
3128 this.MappingFlags = (PInvokeAttributes) LEBitConverter.ToUInt16(buff, offs);
3129 offs += sizeof (ushort);
3130 this.MemberForwarded = TabsDecoder.DecodeToken(CodedTokenId.MemberForwarded, LEBitConverter.ToInt32(buff, offs));
3131 offs += 4;
3132 this.ImportName = LEBitConverter.ToInt32(buff, offs);
3133 offs += 4;
3134 this.ImportScope = LEBitConverter.ToInt32(buff, offs);
3140 /// <summary>
3141 /// </summary>
3142 public void Dump(TextWriter writer) {
3143 string dump = String.Format(
3144 "MappingFlags : {0}" + Environment.NewLine +
3145 "MemberForwarded : {1}" + Environment.NewLine +
3146 "ImportName : {2}" + Environment.NewLine +
3147 "ImportScope : {3}" + Environment.NewLine,
3148 this.MappingFlags,
3149 this.MemberForwarded,
3150 (Table == null) ? ImportName.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [ImportName] + "\" (#Strings[0x" + ImportName.ToString("X") + "])",
3151 "ModuleRef[" + ImportScope.ToString() + "]"
3153 writer.WriteLine(dump);
3157 /// <summary>
3158 /// </summary>
3159 public override string ToString()
3161 StringWriter sw = new StringWriter();
3162 Dump(sw);
3163 return sw.ToString();
3170 /// <summary>
3171 /// Represents row in FieldRVA table.
3172 /// </summary>
3173 /// <remarks>
3174 /// See Partition II, Metadata; section 21.18
3175 /// </remarks>
3176 public class FieldRVARow : Row {
3178 private MDTable table;
3181 public RVA RVA;
3182 public int Field;
3184 public FieldRVARow()
3188 public FieldRVARow(MDTable parent)
3190 table = parent;
3194 /// <summary>
3195 /// Row in FieldRVA table has 2 columns.
3196 /// </summary>
3197 public virtual int NumberOfColumns {
3198 get {
3199 return 2;
3204 /// <summary>
3205 /// Logical size of this instance in bytes.
3206 /// </summary>
3207 public virtual int Size {
3208 get {
3209 return LogicalSize;
3214 /// <summary>
3215 /// </summary>
3216 public virtual MDTable Table {
3217 get {
3218 return table;
3223 /// <summary>
3224 /// Logical size of this type of row in bytes.
3225 /// </summary>
3226 unsafe public static int LogicalSize {
3227 get {
3228 return RVA.Size + 4;
3233 /// <summary>
3234 /// Fills the row from the array of bytes.
3235 /// </summary>
3236 unsafe public void FromRawData(byte [] buff, int offs)
3238 if (buff == null) throw new Exception("buff == null");
3239 if (offs + Size > buff.Length) throw new Exception("bounds");
3242 this.RVA = LEBitConverter.ToUInt32(buff, offs);
3243 offs += RVA.Size;
3244 this.Field = LEBitConverter.ToInt32(buff, offs);
3250 /// <summary>
3251 /// </summary>
3252 public void Dump(TextWriter writer) {
3253 string dump = String.Format(
3254 "RVA : {0}" + Environment.NewLine +
3255 "Field : {1}" + Environment.NewLine,
3256 this.RVA,
3257 "Field[" + Field.ToString() + "]"
3259 writer.WriteLine(dump);
3263 /// <summary>
3264 /// </summary>
3265 public override string ToString()
3267 StringWriter sw = new StringWriter();
3268 Dump(sw);
3269 return sw.ToString();
3276 /// <summary>
3277 /// Represents row in ENCLog table.
3278 /// </summary>
3279 /// <remarks>
3280 ///
3281 /// </remarks>
3282 public class ENCLogRow : Row {
3284 private MDTable table;
3287 public uint Token;
3288 public uint FuncCode;
3290 public ENCLogRow()
3294 public ENCLogRow(MDTable parent)
3296 table = parent;
3300 /// <summary>
3301 /// Row in ENCLog table has 2 columns.
3302 /// </summary>
3303 public virtual int NumberOfColumns {
3304 get {
3305 return 2;
3310 /// <summary>
3311 /// Logical size of this instance in bytes.
3312 /// </summary>
3313 public virtual int Size {
3314 get {
3315 return LogicalSize;
3320 /// <summary>
3321 /// </summary>
3322 public virtual MDTable Table {
3323 get {
3324 return table;
3329 /// <summary>
3330 /// Logical size of this type of row in bytes.
3331 /// </summary>
3332 unsafe public static int LogicalSize {
3333 get {
3334 return sizeof (uint) + sizeof (uint);
3339 /// <summary>
3340 /// Fills the row from the array of bytes.
3341 /// </summary>
3342 unsafe public void FromRawData(byte [] buff, int offs)
3344 if (buff == null) throw new Exception("buff == null");
3345 if (offs + Size > buff.Length) throw new Exception("bounds");
3348 this.Token = LEBitConverter.ToUInt32(buff, offs);
3349 offs += sizeof (uint);
3350 this.FuncCode = LEBitConverter.ToUInt32(buff, offs);
3356 /// <summary>
3357 /// </summary>
3358 public void Dump(TextWriter writer) {
3359 string dump = String.Format(
3360 "Token : {0}" + Environment.NewLine +
3361 "FuncCode : {1}" + Environment.NewLine,
3362 this.Token,
3363 this.FuncCode
3365 writer.WriteLine(dump);
3369 /// <summary>
3370 /// </summary>
3371 public override string ToString()
3373 StringWriter sw = new StringWriter();
3374 Dump(sw);
3375 return sw.ToString();
3382 /// <summary>
3383 /// Represents row in ENCMap table.
3384 /// </summary>
3385 /// <remarks>
3386 ///
3387 /// </remarks>
3388 public class ENCMapRow : Row {
3390 private MDTable table;
3393 public uint Token;
3395 public ENCMapRow()
3399 public ENCMapRow(MDTable parent)
3401 table = parent;
3405 /// <summary>
3406 /// Row in ENCMap table has 1 columns.
3407 /// </summary>
3408 public virtual int NumberOfColumns {
3409 get {
3410 return 1;
3415 /// <summary>
3416 /// Logical size of this instance in bytes.
3417 /// </summary>
3418 public virtual int Size {
3419 get {
3420 return LogicalSize;
3425 /// <summary>
3426 /// </summary>
3427 public virtual MDTable Table {
3428 get {
3429 return table;
3434 /// <summary>
3435 /// Logical size of this type of row in bytes.
3436 /// </summary>
3437 unsafe public static int LogicalSize {
3438 get {
3439 return sizeof (uint);
3444 /// <summary>
3445 /// Fills the row from the array of bytes.
3446 /// </summary>
3447 unsafe public void FromRawData(byte [] buff, int offs)
3449 if (buff == null) throw new Exception("buff == null");
3450 if (offs + Size > buff.Length) throw new Exception("bounds");
3453 this.Token = LEBitConverter.ToUInt32(buff, offs);
3459 /// <summary>
3460 /// </summary>
3461 public void Dump(TextWriter writer) {
3462 string dump = String.Format(
3463 "Token : {0}" + Environment.NewLine,
3464 this.Token
3466 writer.WriteLine(dump);
3470 /// <summary>
3471 /// </summary>
3472 public override string ToString()
3474 StringWriter sw = new StringWriter();
3475 Dump(sw);
3476 return sw.ToString();
3483 /// <summary>
3484 /// Represents row in Assembly table.
3485 /// </summary>
3486 /// <remarks>
3487 /// See Partition II, Metadata; section 21.2
3488 /// </remarks>
3489 public class AssemblyRow : Row {
3491 private MDTable table;
3494 public System.Configuration.Assemblies.AssemblyHashAlgorithm HashAlgId;
3495 public short MajorVersion;
3496 public short MinorVersion;
3497 public short BuildNumber;
3498 public short RevisionNumber;
3499 public AssemblyFlags Flags;
3500 public int PublicKey;
3501 public int Name;
3502 public int Culture;
3504 public AssemblyRow()
3508 public AssemblyRow(MDTable parent)
3510 table = parent;
3514 /// <summary>
3515 /// Row in Assembly table has 9 columns.
3516 /// </summary>
3517 public virtual int NumberOfColumns {
3518 get {
3519 return 9;
3524 /// <summary>
3525 /// Logical size of this instance in bytes.
3526 /// </summary>
3527 public virtual int Size {
3528 get {
3529 return LogicalSize;
3534 /// <summary>
3535 /// </summary>
3536 public virtual MDTable Table {
3537 get {
3538 return table;
3543 /// <summary>
3544 /// Logical size of this type of row in bytes.
3545 /// </summary>
3546 unsafe public static int LogicalSize {
3547 get {
3548 return sizeof (int) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (uint) + 4 + 4 + 4;
3553 /// <summary>
3554 /// Fills the row from the array of bytes.
3555 /// </summary>
3556 unsafe public void FromRawData(byte [] buff, int offs)
3558 if (buff == null) throw new Exception("buff == null");
3559 if (offs + Size > buff.Length) throw new Exception("bounds");
3562 this.HashAlgId = (System.Configuration.Assemblies.AssemblyHashAlgorithm) LEBitConverter.ToInt32(buff, offs);
3563 offs += sizeof (int);
3564 this.MajorVersion = LEBitConverter.ToInt16(buff, offs);
3565 offs += sizeof (short);
3566 this.MinorVersion = LEBitConverter.ToInt16(buff, offs);
3567 offs += sizeof (short);
3568 this.BuildNumber = LEBitConverter.ToInt16(buff, offs);
3569 offs += sizeof (short);
3570 this.RevisionNumber = LEBitConverter.ToInt16(buff, offs);
3571 offs += sizeof (short);
3572 this.Flags = (AssemblyFlags) LEBitConverter.ToUInt32(buff, offs);
3573 offs += sizeof (uint);
3574 this.PublicKey = LEBitConverter.ToInt32(buff, offs);
3575 offs += 4;
3576 this.Name = LEBitConverter.ToInt32(buff, offs);
3577 offs += 4;
3578 this.Culture = LEBitConverter.ToInt32(buff, offs);
3584 /// <summary>
3585 /// </summary>
3586 public void Dump(TextWriter writer) {
3587 string dump = String.Format(
3588 "HashAlgId : {0}" + Environment.NewLine +
3589 "MajorVersion : {1}" + Environment.NewLine +
3590 "MinorVersion : {2}" + Environment.NewLine +
3591 "BuildNumber : {3}" + Environment.NewLine +
3592 "RevisionNumber : {4}" + Environment.NewLine +
3593 "Flags : {5}" + Environment.NewLine +
3594 "PublicKey : {6}" + Environment.NewLine +
3595 "Name : {7}" + Environment.NewLine +
3596 "Culture : {8}" + Environment.NewLine,
3597 this.HashAlgId,
3598 this.MajorVersion,
3599 this.MinorVersion,
3600 this.BuildNumber,
3601 this.RevisionNumber,
3602 (int)this.Flags,
3603 "#Blob[" + PublicKey.ToString() + "]",
3604 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
3605 (Table == null) ? Culture.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Culture] + "\" (#Strings[0x" + Culture.ToString("X") + "])"
3607 writer.WriteLine(dump);
3611 /// <summary>
3612 /// </summary>
3613 public override string ToString()
3615 StringWriter sw = new StringWriter();
3616 Dump(sw);
3617 return sw.ToString();
3624 /// <summary>
3625 /// Represents row in AssemblyProcessor table.
3626 /// </summary>
3627 /// <remarks>
3628 /// See Partition II, Metadata; section 21.4
3629 /// </remarks>
3630 public class AssemblyProcessorRow : Row {
3632 private MDTable table;
3635 public int Processor;
3637 public AssemblyProcessorRow()
3641 public AssemblyProcessorRow(MDTable parent)
3643 table = parent;
3647 /// <summary>
3648 /// Row in AssemblyProcessor table has 1 columns.
3649 /// </summary>
3650 public virtual int NumberOfColumns {
3651 get {
3652 return 1;
3657 /// <summary>
3658 /// Logical size of this instance in bytes.
3659 /// </summary>
3660 public virtual int Size {
3661 get {
3662 return LogicalSize;
3667 /// <summary>
3668 /// </summary>
3669 public virtual MDTable Table {
3670 get {
3671 return table;
3676 /// <summary>
3677 /// Logical size of this type of row in bytes.
3678 /// </summary>
3679 unsafe public static int LogicalSize {
3680 get {
3681 return sizeof (int);
3686 /// <summary>
3687 /// Fills the row from the array of bytes.
3688 /// </summary>
3689 unsafe public void FromRawData(byte [] buff, int offs)
3691 if (buff == null) throw new Exception("buff == null");
3692 if (offs + Size > buff.Length) throw new Exception("bounds");
3695 this.Processor = LEBitConverter.ToInt32(buff, offs);
3701 /// <summary>
3702 /// </summary>
3703 public void Dump(TextWriter writer) {
3704 string dump = String.Format(
3705 "Processor : {0}" + Environment.NewLine,
3706 this.Processor
3708 writer.WriteLine(dump);
3712 /// <summary>
3713 /// </summary>
3714 public override string ToString()
3716 StringWriter sw = new StringWriter();
3717 Dump(sw);
3718 return sw.ToString();
3725 /// <summary>
3726 /// Represents row in AssemblyOS table.
3727 /// </summary>
3728 /// <remarks>
3729 /// See Partition II, Metadata; section 21.3
3730 /// </remarks>
3731 public class AssemblyOSRow : Row {
3733 private MDTable table;
3736 public int OSPlatformID;
3737 public int OSMajorVersion;
3738 public int OSMinorVersion;
3740 public AssemblyOSRow()
3744 public AssemblyOSRow(MDTable parent)
3746 table = parent;
3750 /// <summary>
3751 /// Row in AssemblyOS table has 3 columns.
3752 /// </summary>
3753 public virtual int NumberOfColumns {
3754 get {
3755 return 3;
3760 /// <summary>
3761 /// Logical size of this instance in bytes.
3762 /// </summary>
3763 public virtual int Size {
3764 get {
3765 return LogicalSize;
3770 /// <summary>
3771 /// </summary>
3772 public virtual MDTable Table {
3773 get {
3774 return table;
3779 /// <summary>
3780 /// Logical size of this type of row in bytes.
3781 /// </summary>
3782 unsafe public static int LogicalSize {
3783 get {
3784 return sizeof (int) + sizeof (int) + sizeof (int);
3789 /// <summary>
3790 /// Fills the row from the array of bytes.
3791 /// </summary>
3792 unsafe public void FromRawData(byte [] buff, int offs)
3794 if (buff == null) throw new Exception("buff == null");
3795 if (offs + Size > buff.Length) throw new Exception("bounds");
3798 this.OSPlatformID = LEBitConverter.ToInt32(buff, offs);
3799 offs += sizeof (int);
3800 this.OSMajorVersion = LEBitConverter.ToInt32(buff, offs);
3801 offs += sizeof (int);
3802 this.OSMinorVersion = LEBitConverter.ToInt32(buff, offs);
3808 /// <summary>
3809 /// </summary>
3810 public void Dump(TextWriter writer) {
3811 string dump = String.Format(
3812 "OSPlatformID : {0}" + Environment.NewLine +
3813 "OSMajorVersion : {1}" + Environment.NewLine +
3814 "OSMinorVersion : {2}" + Environment.NewLine,
3815 this.OSPlatformID,
3816 this.OSMajorVersion,
3817 this.OSMinorVersion
3819 writer.WriteLine(dump);
3823 /// <summary>
3824 /// </summary>
3825 public override string ToString()
3827 StringWriter sw = new StringWriter();
3828 Dump(sw);
3829 return sw.ToString();
3836 /// <summary>
3837 /// Represents row in AssemblyRef table.
3838 /// </summary>
3839 /// <remarks>
3840 /// See Partition II, Metadata; section 21.5
3841 /// </remarks>
3842 public class AssemblyRefRow : Row {
3844 private MDTable table;
3847 public short MajorVersion;
3848 public short MinorVersion;
3849 public short BuildNumber;
3850 public short RevisionNumber;
3851 public AssemblyFlags Flags;
3852 public int PublicKeyOrToken;
3853 public int Name;
3854 public int Culture;
3855 public int HashValue;
3857 public AssemblyRefRow()
3861 public AssemblyRefRow(MDTable parent)
3863 table = parent;
3867 /// <summary>
3868 /// Row in AssemblyRef table has 9 columns.
3869 /// </summary>
3870 public virtual int NumberOfColumns {
3871 get {
3872 return 9;
3877 /// <summary>
3878 /// Logical size of this instance in bytes.
3879 /// </summary>
3880 public virtual int Size {
3881 get {
3882 return LogicalSize;
3887 /// <summary>
3888 /// </summary>
3889 public virtual MDTable Table {
3890 get {
3891 return table;
3896 /// <summary>
3897 /// Logical size of this type of row in bytes.
3898 /// </summary>
3899 unsafe public static int LogicalSize {
3900 get {
3901 return sizeof (short) + sizeof (short) + sizeof (short) + sizeof (short) + sizeof (uint) + 4 + 4 + 4 + 4;
3906 /// <summary>
3907 /// Fills the row from the array of bytes.
3908 /// </summary>
3909 unsafe public void FromRawData(byte [] buff, int offs)
3911 if (buff == null) throw new Exception("buff == null");
3912 if (offs + Size > buff.Length) throw new Exception("bounds");
3915 this.MajorVersion = LEBitConverter.ToInt16(buff, offs);
3916 offs += sizeof (short);
3917 this.MinorVersion = LEBitConverter.ToInt16(buff, offs);
3918 offs += sizeof (short);
3919 this.BuildNumber = LEBitConverter.ToInt16(buff, offs);
3920 offs += sizeof (short);
3921 this.RevisionNumber = LEBitConverter.ToInt16(buff, offs);
3922 offs += sizeof (short);
3923 this.Flags = (AssemblyFlags) LEBitConverter.ToUInt32(buff, offs);
3924 offs += sizeof (uint);
3925 this.PublicKeyOrToken = LEBitConverter.ToInt32(buff, offs);
3926 offs += 4;
3927 this.Name = LEBitConverter.ToInt32(buff, offs);
3928 offs += 4;
3929 this.Culture = LEBitConverter.ToInt32(buff, offs);
3930 offs += 4;
3931 this.HashValue = LEBitConverter.ToInt32(buff, offs);
3937 /// <summary>
3938 /// </summary>
3939 public void Dump(TextWriter writer) {
3940 string dump = String.Format(
3941 "MajorVersion : {0}" + Environment.NewLine +
3942 "MinorVersion : {1}" + Environment.NewLine +
3943 "BuildNumber : {2}" + Environment.NewLine +
3944 "RevisionNumber : {3}" + Environment.NewLine +
3945 "Flags : {4}" + Environment.NewLine +
3946 "PublicKeyOrToken : {5}" + Environment.NewLine +
3947 "Name : {6}" + Environment.NewLine +
3948 "Culture : {7}" + Environment.NewLine +
3949 "HashValue : {8}" + Environment.NewLine,
3950 this.MajorVersion,
3951 this.MinorVersion,
3952 this.BuildNumber,
3953 this.RevisionNumber,
3954 (int)this.Flags,
3955 "#Blob[" + PublicKeyOrToken.ToString() + "]",
3956 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
3957 (Table == null) ? Culture.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Culture] + "\" (#Strings[0x" + Culture.ToString("X") + "])",
3958 "#Blob[" + HashValue.ToString() + "]"
3960 writer.WriteLine(dump);
3964 /// <summary>
3965 /// </summary>
3966 public override string ToString()
3968 StringWriter sw = new StringWriter();
3969 Dump(sw);
3970 return sw.ToString();
3977 /// <summary>
3978 /// Represents row in AssemblyRefProcessor table.
3979 /// </summary>
3980 /// <remarks>
3981 /// See Partition II, Metadata; section 21.7
3982 /// </remarks>
3983 public class AssemblyRefProcessorRow : Row {
3985 private MDTable table;
3988 public int Processor;
3989 public int AssemblyRef;
3991 public AssemblyRefProcessorRow()
3995 public AssemblyRefProcessorRow(MDTable parent)
3997 table = parent;
4001 /// <summary>
4002 /// Row in AssemblyRefProcessor table has 2 columns.
4003 /// </summary>
4004 public virtual int NumberOfColumns {
4005 get {
4006 return 2;
4011 /// <summary>
4012 /// Logical size of this instance in bytes.
4013 /// </summary>
4014 public virtual int Size {
4015 get {
4016 return LogicalSize;
4021 /// <summary>
4022 /// </summary>
4023 public virtual MDTable Table {
4024 get {
4025 return table;
4030 /// <summary>
4031 /// Logical size of this type of row in bytes.
4032 /// </summary>
4033 unsafe public static int LogicalSize {
4034 get {
4035 return sizeof (int) + 4;
4040 /// <summary>
4041 /// Fills the row from the array of bytes.
4042 /// </summary>
4043 unsafe public void FromRawData(byte [] buff, int offs)
4045 if (buff == null) throw new Exception("buff == null");
4046 if (offs + Size > buff.Length) throw new Exception("bounds");
4049 this.Processor = LEBitConverter.ToInt32(buff, offs);
4050 offs += sizeof (int);
4051 this.AssemblyRef = LEBitConverter.ToInt32(buff, offs);
4057 /// <summary>
4058 /// </summary>
4059 public void Dump(TextWriter writer) {
4060 string dump = String.Format(
4061 "Processor : {0}" + Environment.NewLine +
4062 "AssemblyRef : {1}" + Environment.NewLine,
4063 this.Processor,
4064 "AssemblyRef[" + AssemblyRef.ToString() + "]"
4066 writer.WriteLine(dump);
4070 /// <summary>
4071 /// </summary>
4072 public override string ToString()
4074 StringWriter sw = new StringWriter();
4075 Dump(sw);
4076 return sw.ToString();
4083 /// <summary>
4084 /// Represents row in AssemblyRefOS table.
4085 /// </summary>
4086 /// <remarks>
4087 /// See Partition II, Metadata; section 21.6
4088 /// </remarks>
4089 public class AssemblyRefOSRow : Row {
4091 private MDTable table;
4094 public int OSPlatformID;
4095 public int OSMajorVersion;
4096 public int OSMinorVersion;
4097 public int AssemblyRef;
4099 public AssemblyRefOSRow()
4103 public AssemblyRefOSRow(MDTable parent)
4105 table = parent;
4109 /// <summary>
4110 /// Row in AssemblyRefOS table has 4 columns.
4111 /// </summary>
4112 public virtual int NumberOfColumns {
4113 get {
4114 return 4;
4119 /// <summary>
4120 /// Logical size of this instance in bytes.
4121 /// </summary>
4122 public virtual int Size {
4123 get {
4124 return LogicalSize;
4129 /// <summary>
4130 /// </summary>
4131 public virtual MDTable Table {
4132 get {
4133 return table;
4138 /// <summary>
4139 /// Logical size of this type of row in bytes.
4140 /// </summary>
4141 unsafe public static int LogicalSize {
4142 get {
4143 return sizeof (int) + sizeof (int) + sizeof (int) + 4;
4148 /// <summary>
4149 /// Fills the row from the array of bytes.
4150 /// </summary>
4151 unsafe public void FromRawData(byte [] buff, int offs)
4153 if (buff == null) throw new Exception("buff == null");
4154 if (offs + Size > buff.Length) throw new Exception("bounds");
4157 this.OSPlatformID = LEBitConverter.ToInt32(buff, offs);
4158 offs += sizeof (int);
4159 this.OSMajorVersion = LEBitConverter.ToInt32(buff, offs);
4160 offs += sizeof (int);
4161 this.OSMinorVersion = LEBitConverter.ToInt32(buff, offs);
4162 offs += sizeof (int);
4163 this.AssemblyRef = LEBitConverter.ToInt32(buff, offs);
4169 /// <summary>
4170 /// </summary>
4171 public void Dump(TextWriter writer) {
4172 string dump = String.Format(
4173 "OSPlatformID : {0}" + Environment.NewLine +
4174 "OSMajorVersion : {1}" + Environment.NewLine +
4175 "OSMinorVersion : {2}" + Environment.NewLine +
4176 "AssemblyRef : {3}" + Environment.NewLine,
4177 this.OSPlatformID,
4178 this.OSMajorVersion,
4179 this.OSMinorVersion,
4180 "AssemblyRef[" + AssemblyRef.ToString() + "]"
4182 writer.WriteLine(dump);
4186 /// <summary>
4187 /// </summary>
4188 public override string ToString()
4190 StringWriter sw = new StringWriter();
4191 Dump(sw);
4192 return sw.ToString();
4199 /// <summary>
4200 /// Represents row in File table.
4201 /// </summary>
4202 /// <remarks>
4203 /// See Partition II, Metadata; section 21.19
4204 /// </remarks>
4205 public class FileRow : Row {
4207 private MDTable table;
4210 public System.IO.FileAttributes Flags;
4211 public int Name;
4212 public int HashValue;
4214 public FileRow()
4218 public FileRow(MDTable parent)
4220 table = parent;
4224 /// <summary>
4225 /// Row in File table has 3 columns.
4226 /// </summary>
4227 public virtual int NumberOfColumns {
4228 get {
4229 return 3;
4234 /// <summary>
4235 /// Logical size of this instance in bytes.
4236 /// </summary>
4237 public virtual int Size {
4238 get {
4239 return LogicalSize;
4244 /// <summary>
4245 /// </summary>
4246 public virtual MDTable Table {
4247 get {
4248 return table;
4253 /// <summary>
4254 /// Logical size of this type of row in bytes.
4255 /// </summary>
4256 unsafe public static int LogicalSize {
4257 get {
4258 return sizeof (uint) + 4 + 4;
4263 /// <summary>
4264 /// Fills the row from the array of bytes.
4265 /// </summary>
4266 unsafe public void FromRawData(byte [] buff, int offs)
4268 if (buff == null) throw new Exception("buff == null");
4269 if (offs + Size > buff.Length) throw new Exception("bounds");
4272 this.Flags = (System.IO.FileAttributes) LEBitConverter.ToUInt32(buff, offs);
4273 offs += sizeof (uint);
4274 this.Name = LEBitConverter.ToInt32(buff, offs);
4275 offs += 4;
4276 this.HashValue = LEBitConverter.ToInt32(buff, offs);
4282 /// <summary>
4283 /// </summary>
4284 public void Dump(TextWriter writer) {
4285 string dump = String.Format(
4286 "Flags : {0}" + Environment.NewLine +
4287 "Name : {1}" + Environment.NewLine +
4288 "HashValue : {2}" + Environment.NewLine,
4289 (int)this.Flags,
4290 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
4291 "#Blob[" + HashValue.ToString() + "]"
4293 writer.WriteLine(dump);
4297 /// <summary>
4298 /// </summary>
4299 public override string ToString()
4301 StringWriter sw = new StringWriter();
4302 Dump(sw);
4303 return sw.ToString();
4310 /// <summary>
4311 /// Represents row in ExportedType table.
4312 /// </summary>
4313 /// <remarks>
4314 /// See Partition II, Metadata; section 21.14
4315 /// </remarks>
4316 public class ExportedTypeRow : Row {
4318 private MDTable table;
4321 public System.Reflection.TypeAttributes Flags;
4322 public int TypeDefId;
4323 public int TypeName;
4324 public int TypeNamespace;
4325 public MDToken Implementation;
4327 public ExportedTypeRow()
4331 public ExportedTypeRow(MDTable parent)
4333 table = parent;
4337 /// <summary>
4338 /// Row in ExportedType table has 5 columns.
4339 /// </summary>
4340 public virtual int NumberOfColumns {
4341 get {
4342 return 5;
4347 /// <summary>
4348 /// Logical size of this instance in bytes.
4349 /// </summary>
4350 public virtual int Size {
4351 get {
4352 return LogicalSize;
4357 /// <summary>
4358 /// </summary>
4359 public virtual MDTable Table {
4360 get {
4361 return table;
4366 /// <summary>
4367 /// Logical size of this type of row in bytes.
4368 /// </summary>
4369 unsafe public static int LogicalSize {
4370 get {
4371 return sizeof (uint) + 4 + 4 + 4 + 4;
4376 /// <summary>
4377 /// Fills the row from the array of bytes.
4378 /// </summary>
4379 unsafe public void FromRawData(byte [] buff, int offs)
4381 if (buff == null) throw new Exception("buff == null");
4382 if (offs + Size > buff.Length) throw new Exception("bounds");
4385 this.Flags = (System.Reflection.TypeAttributes) LEBitConverter.ToUInt32(buff, offs);
4386 offs += sizeof (uint);
4387 this.TypeDefId = LEBitConverter.ToInt32(buff, offs);
4388 offs += 4;
4389 this.TypeName = LEBitConverter.ToInt32(buff, offs);
4390 offs += 4;
4391 this.TypeNamespace = LEBitConverter.ToInt32(buff, offs);
4392 offs += 4;
4393 this.Implementation = TabsDecoder.DecodeToken(CodedTokenId.Implementation, LEBitConverter.ToInt32(buff, offs));
4399 /// <summary>
4400 /// </summary>
4401 public void Dump(TextWriter writer) {
4402 string dump = String.Format(
4403 "Flags : {0}" + Environment.NewLine +
4404 "TypeDefId : {1}" + Environment.NewLine +
4405 "TypeName : {2}" + Environment.NewLine +
4406 "TypeNamespace : {3}" + Environment.NewLine +
4407 "Implementation : {4}" + Environment.NewLine,
4408 (int)this.Flags,
4409 "TypeDef[" + TypeDefId.ToString() + "]",
4410 (Table == null) ? TypeName.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [TypeName] + "\" (#Strings[0x" + TypeName.ToString("X") + "])",
4411 (Table == null) ? TypeNamespace.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [TypeNamespace] + "\" (#Strings[0x" + TypeNamespace.ToString("X") + "])",
4412 this.Implementation
4414 writer.WriteLine(dump);
4418 /// <summary>
4419 /// </summary>
4420 public override string ToString()
4422 StringWriter sw = new StringWriter();
4423 Dump(sw);
4424 return sw.ToString();
4431 /// <summary>
4432 /// Represents row in ManifestResource table.
4433 /// </summary>
4434 /// <remarks>
4435 /// See Partition II, Metadata; section 21.22
4436 /// </remarks>
4437 public class ManifestResourceRow : Row {
4439 private MDTable table;
4442 public int Offset;
4443 public ManifestResourceAttributes Flags;
4444 public int Name;
4445 public MDToken Implementation;
4447 public ManifestResourceRow()
4451 public ManifestResourceRow(MDTable parent)
4453 table = parent;
4457 /// <summary>
4458 /// Row in ManifestResource table has 4 columns.
4459 /// </summary>
4460 public virtual int NumberOfColumns {
4461 get {
4462 return 4;
4467 /// <summary>
4468 /// Logical size of this instance in bytes.
4469 /// </summary>
4470 public virtual int Size {
4471 get {
4472 return LogicalSize;
4477 /// <summary>
4478 /// </summary>
4479 public virtual MDTable Table {
4480 get {
4481 return table;
4486 /// <summary>
4487 /// Logical size of this type of row in bytes.
4488 /// </summary>
4489 unsafe public static int LogicalSize {
4490 get {
4491 return sizeof (int) + sizeof (uint) + 4 + 4;
4496 /// <summary>
4497 /// Fills the row from the array of bytes.
4498 /// </summary>
4499 unsafe public void FromRawData(byte [] buff, int offs)
4501 if (buff == null) throw new Exception("buff == null");
4502 if (offs + Size > buff.Length) throw new Exception("bounds");
4505 this.Offset = LEBitConverter.ToInt32(buff, offs);
4506 offs += sizeof (int);
4507 this.Flags = (ManifestResourceAttributes) LEBitConverter.ToUInt32(buff, offs);
4508 offs += sizeof (uint);
4509 this.Name = LEBitConverter.ToInt32(buff, offs);
4510 offs += 4;
4511 this.Implementation = TabsDecoder.DecodeToken(CodedTokenId.Implementation, LEBitConverter.ToInt32(buff, offs));
4517 /// <summary>
4518 /// </summary>
4519 public void Dump(TextWriter writer) {
4520 string dump = String.Format(
4521 "Offset : {0}" + Environment.NewLine +
4522 "Flags : {1}" + Environment.NewLine +
4523 "Name : {2}" + Environment.NewLine +
4524 "Implementation : {3}" + Environment.NewLine,
4525 this.Offset,
4526 (int)this.Flags,
4527 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])",
4528 this.Implementation
4530 writer.WriteLine(dump);
4534 /// <summary>
4535 /// </summary>
4536 public override string ToString()
4538 StringWriter sw = new StringWriter();
4539 Dump(sw);
4540 return sw.ToString();
4547 /// <summary>
4548 /// Represents row in NestedClass table.
4549 /// </summary>
4550 /// <remarks>
4551 /// See Partition II, Metadata; section 21.29
4552 /// </remarks>
4553 public class NestedClassRow : Row {
4555 private MDTable table;
4558 public int NestedClass;
4559 public int EnclosingClass;
4561 public NestedClassRow()
4565 public NestedClassRow(MDTable parent)
4567 table = parent;
4571 /// <summary>
4572 /// Row in NestedClass table has 2 columns.
4573 /// </summary>
4574 public virtual int NumberOfColumns {
4575 get {
4576 return 2;
4581 /// <summary>
4582 /// Logical size of this instance in bytes.
4583 /// </summary>
4584 public virtual int Size {
4585 get {
4586 return LogicalSize;
4591 /// <summary>
4592 /// </summary>
4593 public virtual MDTable Table {
4594 get {
4595 return table;
4600 /// <summary>
4601 /// Logical size of this type of row in bytes.
4602 /// </summary>
4603 unsafe public static int LogicalSize {
4604 get {
4605 return 4 + 4;
4610 /// <summary>
4611 /// Fills the row from the array of bytes.
4612 /// </summary>
4613 unsafe public void FromRawData(byte [] buff, int offs)
4615 if (buff == null) throw new Exception("buff == null");
4616 if (offs + Size > buff.Length) throw new Exception("bounds");
4619 this.NestedClass = LEBitConverter.ToInt32(buff, offs);
4620 offs += 4;
4621 this.EnclosingClass = LEBitConverter.ToInt32(buff, offs);
4627 /// <summary>
4628 /// </summary>
4629 public void Dump(TextWriter writer) {
4630 string dump = String.Format(
4631 "NestedClass : {0}" + Environment.NewLine +
4632 "EnclosingClass : {1}" + Environment.NewLine,
4633 "TypeDef[" + NestedClass.ToString() + "]",
4634 "TypeDef[" + EnclosingClass.ToString() + "]"
4636 writer.WriteLine(dump);
4640 /// <summary>
4641 /// </summary>
4642 public override string ToString()
4644 StringWriter sw = new StringWriter();
4645 Dump(sw);
4646 return sw.ToString();
4653 /// <summary>
4654 /// Represents row in TypeTyPar table.
4655 /// </summary>
4656 /// <remarks>
4657 ///
4658 /// </remarks>
4659 public class TypeTyParRow : Row {
4661 private MDTable table;
4664 public ushort Number;
4665 public int Class;
4666 public MDToken Bound;
4667 public int Name;
4669 public TypeTyParRow()
4673 public TypeTyParRow(MDTable parent)
4675 table = parent;
4679 /// <summary>
4680 /// Row in TypeTyPar table has 4 columns.
4681 /// </summary>
4682 public virtual int NumberOfColumns {
4683 get {
4684 return 4;
4689 /// <summary>
4690 /// Logical size of this instance in bytes.
4691 /// </summary>
4692 public virtual int Size {
4693 get {
4694 return LogicalSize;
4699 /// <summary>
4700 /// </summary>
4701 public virtual MDTable Table {
4702 get {
4703 return table;
4708 /// <summary>
4709 /// Logical size of this type of row in bytes.
4710 /// </summary>
4711 unsafe public static int LogicalSize {
4712 get {
4713 return sizeof (ushort) + 4 + 4 + 4;
4718 /// <summary>
4719 /// Fills the row from the array of bytes.
4720 /// </summary>
4721 unsafe public void FromRawData(byte [] buff, int offs)
4723 if (buff == null) throw new Exception("buff == null");
4724 if (offs + Size > buff.Length) throw new Exception("bounds");
4727 this.Number = LEBitConverter.ToUInt16(buff, offs);
4728 offs += sizeof (ushort);
4729 this.Class = LEBitConverter.ToInt32(buff, offs);
4730 offs += 4;
4731 this.Bound = TabsDecoder.DecodeToken(CodedTokenId.TypeDefOrRef, LEBitConverter.ToInt32(buff, offs));
4732 offs += 4;
4733 this.Name = LEBitConverter.ToInt32(buff, offs);
4739 /// <summary>
4740 /// </summary>
4741 public void Dump(TextWriter writer) {
4742 string dump = String.Format(
4743 "Number : {0}" + Environment.NewLine +
4744 "Class : {1}" + Environment.NewLine +
4745 "Bound : {2}" + Environment.NewLine +
4746 "Name : {3}" + Environment.NewLine,
4747 this.Number,
4748 "TypeDef[" + Class.ToString() + "]",
4749 this.Bound,
4750 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])"
4752 writer.WriteLine(dump);
4756 /// <summary>
4757 /// </summary>
4758 public override string ToString()
4760 StringWriter sw = new StringWriter();
4761 Dump(sw);
4762 return sw.ToString();
4769 /// <summary>
4770 /// Represents row in MethodTyPar table.
4771 /// </summary>
4772 /// <remarks>
4773 ///
4774 /// </remarks>
4775 public class MethodTyParRow : Row {
4777 private MDTable table;
4780 public ushort Number;
4781 public int Method;
4782 public MDToken Bound;
4783 public int Name;
4785 public MethodTyParRow()
4789 public MethodTyParRow(MDTable parent)
4791 table = parent;
4795 /// <summary>
4796 /// Row in MethodTyPar table has 4 columns.
4797 /// </summary>
4798 public virtual int NumberOfColumns {
4799 get {
4800 return 4;
4805 /// <summary>
4806 /// Logical size of this instance in bytes.
4807 /// </summary>
4808 public virtual int Size {
4809 get {
4810 return LogicalSize;
4815 /// <summary>
4816 /// </summary>
4817 public virtual MDTable Table {
4818 get {
4819 return table;
4824 /// <summary>
4825 /// Logical size of this type of row in bytes.
4826 /// </summary>
4827 unsafe public static int LogicalSize {
4828 get {
4829 return sizeof (ushort) + 4 + 4 + 4;
4834 /// <summary>
4835 /// Fills the row from the array of bytes.
4836 /// </summary>
4837 unsafe public void FromRawData(byte [] buff, int offs)
4839 if (buff == null) throw new Exception("buff == null");
4840 if (offs + Size > buff.Length) throw new Exception("bounds");
4843 this.Number = LEBitConverter.ToUInt16(buff, offs);
4844 offs += sizeof (ushort);
4845 this.Method = LEBitConverter.ToInt32(buff, offs);
4846 offs += 4;
4847 this.Bound = TabsDecoder.DecodeToken(CodedTokenId.TypeDefOrRef, LEBitConverter.ToInt32(buff, offs));
4848 offs += 4;
4849 this.Name = LEBitConverter.ToInt32(buff, offs);
4855 /// <summary>
4856 /// </summary>
4857 public void Dump(TextWriter writer) {
4858 string dump = String.Format(
4859 "Number : {0}" + Environment.NewLine +
4860 "Method : {1}" + Environment.NewLine +
4861 "Bound : {2}" + Environment.NewLine +
4862 "Name : {3}" + Environment.NewLine,
4863 this.Number,
4864 "Method[" + Method.ToString() + "]",
4865 this.Bound,
4866 (Table == null) ? Name.ToString() : "\"" + ((Table.Heap.Stream.Root.Streams["#Strings"] as MDStream).Heap as StringsHeap) [Name] + "\" (#Strings[0x" + Name.ToString("X") + "])"
4868 writer.WriteLine(dump);
4872 /// <summary>
4873 /// </summary>
4874 public override string ToString()
4876 StringWriter sw = new StringWriter();
4877 Dump(sw);
4878 return sw.ToString();