本文整理汇总了C#中MDTable类的典型用法代码示例。如果您正苦于以下问题:C# MDTable类的具体用法?C# MDTable怎么用?C# MDTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MDTable类属于命名空间,在下文中一共展示了MDTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MethodRow
public MethodRow(MDTable parent)
{
table = parent;
}
示例2: AddToTable
internal void AddToTable(MDTable tableIx, MetaDataElement elem)
{
if (elem.Row > 0) {
// Console.Out.WriteLine("ERROR - element already in table " + tableIx);
return;
}
// updates Row field of the element
// Console.WriteLine("Adding element to table " + (uint)tableIx);
ArrayList table = GetTable(tableIx);
elem.Row = (uint)table.Count + 1;
table.Add(elem);
}
示例3: TableIndexSize
internal uint TableIndexSize(MDTable tabIx)
{
if (largeIx[(uint)tabIx]) return 4;
return 2;
}
示例4: AddToList
internal void AddToList(ArrayList list, MDTable tabIx)
{
Contract.Requires(list != null);
switch (tabIx)
{
case (MDTable.Field): fields.AddRange(list); break;
case (MDTable.Method): methods.AddRange(list); break;
case (MDTable.TypeDef): nestedClasses.AddRange(list); break;
default: throw new Exception("Unknown list type");
}
}
示例5: MapElem
internal MapElem(ClassDef par, uint elIx, MDTable elemTab)
{
parent = par;
elemIx = elIx;
elemTable = elemTab;
}
示例6: AddToFeatureList
internal void AddToFeatureList(ArrayList list, MDTable tabIx)
{
if (tabIx == MDTable.Event) {
events.AddRange(list);
} else {
properties.AddRange(list);
}
}
示例7: AddToTable
internal void AddToTable(MDTable tableIx, MetaDataElement elem)
{
// Console.WriteLine("Adding element to table " + (uint)tableIx);
ArrayList table = GetTable(tableIx);
if (table.Contains(elem)) {
Console.Out.WriteLine("ERROR - element already in table " + tableIx);
return;
}
elem.Row = (uint)table.Count + 1;
table.Add(elem);
}
示例8: MapElem
internal MapElem(ClassDef classDef, ClassDef paren, MDTable tableIx)
{
theClass = classDef;
parent = paren;
tabIx = tableIx;
sortTable = tabIx == MDTable.NestedClass;
}
示例9: InsertInTable
internal void InsertInTable(MDTable tabIx, uint ix, MetaDataElement elem)
{
Contract.Requires(elem != null);
tables[(int)tabIx][ix - 1] = elem;
}
示例10: ReadColumn
/// <summary>
/// Reads a column
/// </summary>
/// <param name="table">The table</param>
/// <param name="rid">Row ID</param>
/// <param name="column">Column</param>
/// <param name="value">Result is put here or 0 if we return <c>false</c></param>
/// <returns><c>true</c> if we could read the column, <c>false</c> otherwise</returns>
public bool ReadColumn(MDTable table, uint rid, ColumnInfo column, out uint value) {
if (table == null || table.IsInvalidRID(rid)) {
value = 0;
return false;
}
if (columnReader != null && columnReader.ReadColumn(table, rid, column, out value))
return true;
var reader = table.ImageStream;
reader.Position = (rid - 1) * table.TableInfo.RowSize + column.Offset;
value = column.Read(reader);
return true;
}
示例11: ParamRow
public ParamRow(MDTable parent)
{
table = parent;
}
示例12: MakeCodedIndex
internal uint MakeCodedIndex(CIx code, MDTable tab, uint ix)
{
ix <<= MetaData.CIxShiftMap[(uint)code];
ix &= (uint)tab;
return ix;
}
示例13: Read
internal static void Read(PEReader buff, TableRow[] maps, MDTable tab)
{
if (tab == MDTable.NestedClass) {
for (int i=0; i < maps.Length; i++) {
//maps[i] = new MapElem(buff,tab);
uint nestClassIx = buff.GetIndex(MDTable.TypeDef);
uint enclClassIx = buff.GetIndex(MDTable.TypeDef);
ClassDef parent = (ClassDef)buff.GetElement(MDTable.TypeDef,enclClassIx);
ClassDef nestClass = ((ClassDef)buff.GetElement(MDTable.TypeDef,nestClassIx)).MakeNestedClass(parent);
buff.InsertInTable(MDTable.TypeDef,nestClass.Row,nestClass);
}
} else { // event or property map
MapElem prev = new MapElem(buff,tab);
maps[0] = prev;
for (int i=1; i < maps.Length; i++) {
maps[i] = new MapElem(buff,tab);
prev.endIx = ((MapElem)maps[i]).elemIx;
prev = (MapElem)maps[i];
}
switch (tab) {
case MDTable.PropertyMap:
prev.endIx = buff.GetTableSize(MDTable.Property) + 1;
break;
case MDTable.EventMap:
prev.endIx = buff.GetTableSize(MDTable.Event) + 1;
break;
default:
prev.endIx = buff.GetTableSize(tab)+1;
break;
}
}
}
示例14: SetElementPosition
internal void SetElementPosition(MDTable tabIx, uint ix)
{
BaseStream.Position = tableStarts[(int)tabIx] + (md.elemSize[(int)tabIx] * (ix-1));
}
示例15: Size
internal static uint Size(MetaData md, MDTable tabIx)
{
return md.TableIndexSize(MDTable.TypeDef) + md.TableIndexSize(tabIx);
}