本文整理汇总了C#中dnlib.DotNet.MD.MDTable类的典型用法代码示例。如果您正苦于以下问题:C# MDTable类的具体用法?C# MDTable怎么用?C# MDTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MDTable类属于dnlib.DotNet.MD命名空间,在下文中一共展示了MDTable类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MDTableModel
public MDTableModel(MDTableHeapModel parent, IMetaData metadata, TablesStream stream, MDTable table) {
Parent = parent;
MetaData = metadata;
Tables = stream;
MDTable = table;
Text = string.Format("{0:x2}: {1} (0x{2:x})", (byte)table.Table, table.Name, table.Rows);
}
示例2: MetaDataTableNode
public MetaDataTableNode(HexDocument doc, MDTable mdTable, IMetaData md)
: base((ulong)mdTable.StartOffset, (ulong)mdTable.EndOffset - 1) {
this.doc = doc;
this.tableInfo = mdTable.TableInfo;
this.tablesStreamVM = MetaDataTableVM.Create(this, doc, StartOffset, mdTable);
this.tablesStreamVM.FindMetaDataTable = FindMetaDataTable;
this.tablesStreamVM.InitializeHeapOffsets((ulong)md.StringsStream.StartOffset, (ulong)md.StringsStream.EndOffset - 1);
}
示例3: GetTableReader
/// <summary>
/// Returns a reader positioned at a table row
/// </summary>
/// <param name="table">Table</param>
/// <param name="rid">A valid row ID (i.e., >= <c>1</c> and <= number of rows)</param>
/// <returns>The reader (owned by us) or <c>null</c> if the row isn't present</returns>
public IImageStream GetTableReader(MDTable table, uint rid) {
long offset;
if (GetRowOffset(table, rid, out offset)) {
fullStream.Position = offset;
return fullStream;
}
return null;
}
示例4: MetaDataTableNode
public MetaDataTableNode(HexBuffer buffer, MDTable mdTable, IMetaData md)
: base(HexSpan.FromBounds((ulong)mdTable.StartOffset, (ulong)mdTable.EndOffset)) {
Buffer = buffer;
TableInfo = mdTable.TableInfo;
var stringsHeapSpan = HexSpan.FromBounds((ulong)md.StringsStream.StartOffset, (ulong)md.StringsStream.EndOffset);
var guidHeapSpan = HexSpan.FromBounds((ulong)md.GuidStream.StartOffset, (ulong)md.GuidStream.EndOffset);
MetaDataTableVM = MetaDataTableVM.Create(this, buffer, Span.Start, mdTable, stringsHeapSpan, guidHeapSpan);
MetaDataTableVM.FindMetaDataTable = FindMetaDataTable;
}
示例5: MetaDataTableVM
protected MetaDataTableVM(object owner, HexBuffer buffer, HexPosition startOffset, MDTable mdTable, HexSpan stringsHeapSpan, HexSpan guidHeapSpan) {
this.buffer = buffer;
this.stringsHeapSpan = stringsHeapSpan;
this.guidHeapSpan = guidHeapSpan;
Owner = owner;
Span = new HexSpan(startOffset, (ulong)mdTable.Rows * mdTable.RowSize);
Rows = mdTable.Rows;
TableInfo = CreateTableInfo(mdTable.TableInfo);
Collection = new VirtualizedList<MetaDataTableRecordVM>((int)Rows, CreateItem);
}
示例6: GetReader_NoLock
IBinaryReader GetReader_NoLock(MDTable table, uint rid) {
IBinaryReader reader;
if (hotTableStream != null) {
reader = hotTableStream.GetTableReader(table, rid);
if (reader != null)
return reader;
}
reader = table.ImageStream;
reader.Position = (rid - 1) * table.TableInfo.RowSize;
return reader;
}
示例7: BinarySearch_NoLock
/// <inheritdoc/>
protected override uint BinarySearch_NoLock(MDTable tableSource, int keyColIndex, uint key)
{
var keyColumn = tableSource.TableInfo.Columns[keyColIndex];
uint ridLo = 1, ridHi = tableSource.Rows;
while (ridLo <= ridHi) {
uint rid = (ridLo + ridHi) / 2;
uint key2;
if (!tablesStream.ReadColumn_NoLock(tableSource, rid, keyColumn, out key2))
break; // Never happens since rid is valid
if (key == key2)
return rid;
if (key2 > key)
ridHi = rid - 1;
else
ridLo = rid + 1;
}
return 0;
}
示例8: Write
/// <summary>
/// Writes a <c>AssemblyRefProcessor</c> table
/// </summary>
/// <param name="writer">Writer</param>
/// <param name="table">Table</param>
public static void Write(this BinaryWriter writer, MDTable<RawAssemblyRefProcessorRow> table) {
var cols = table.TableInfo.Columns;
foreach (var row in table) {
writer.Write(row.Processor);
cols[1].Write(writer, row.AssemblyRef);
}
}