本文整理汇总了C#中dnlib.DotNet.MD.MDTable.IsInvalidRID方法的典型用法代码示例。如果您正苦于以下问题:C# MDTable.IsInvalidRID方法的具体用法?C# MDTable.IsInvalidRID怎么用?C# MDTable.IsInvalidRID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dnlib.DotNet.MD.MDTable
的用法示例。
在下文中一共展示了MDTable.IsInvalidRID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FindAllRows
/// <summary>
/// Finds all rows owned by <paramref name="key"/> in table <paramref name="tableSource"/>
/// whose index is <paramref name="keyColIndex"/>
/// </summary>
/// <param name="tableSource">Table to search</param>
/// <param name="keyColIndex">Key column index</param>
/// <param name="key">Key</param>
/// <returns>A <see cref="RidList"/> instance</returns>
protected RidList FindAllRows(MDTable tableSource, int keyColIndex, uint key)
{
#if THREAD_SAFE
tablesStream.theLock.EnterWriteLock(); try {
#endif
uint startRid = BinarySearch_NoLock(tableSource, keyColIndex, key);
if (tableSource.IsInvalidRID(startRid))
return RidList.Empty;
uint endRid = startRid + 1;
var column = tableSource.TableInfo.Columns[keyColIndex];
for (; startRid > 1; startRid--) {
uint key2;
if (!tablesStream.ReadColumn_NoLock(tableSource, startRid - 1, column, out key2))
break; // Should never happen since startRid is valid
if (key != key2)
break;
}
for (; endRid <= tableSource.Rows; endRid++) {
uint key2;
if (!tablesStream.ReadColumn_NoLock(tableSource, endRid, column, out key2))
break; // Should never happen since endRid is valid
if (key != key2)
break;
}
return new ContiguousRidList(startRid, endRid - startRid);
#if THREAD_SAFE
} finally { tablesStream.theLock.ExitWriteLock(); }
#endif
}
示例2: ReadColumn_NoLock
/// <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>
internal bool ReadColumn_NoLock(MDTable table, uint rid, ColumnInfo column, out uint value) {
if (table.IsInvalidRID(rid)) {
value = 0;
return false;
}
var cr = columnReader;
if (cr != null && cr.ReadColumn(table, rid, column, out value))
return true;
var reader = GetReader_NoLock(table, rid);
reader.Position += column.Offset;
value = column.Read(reader);
return true;
}
示例3: FindAllRows
/// <summary>
/// Finds all rows owned by <paramref name="key"/> in table <paramref name="tableSource"/>
/// whose index is <paramref name="keyColIndex"/>
/// </summary>
/// <param name="tableSource">Table to search</param>
/// <param name="keyColIndex">Key column index</param>
/// <param name="key">Key</param>
/// <returns>A <see cref="RidList"/> instance</returns>
protected RidList FindAllRows(MDTable tableSource, int keyColIndex, uint key) {
uint startRid = BinarySearch(tableSource, keyColIndex, key);
if (tableSource == null || tableSource.IsInvalidRID(startRid))
return RidList.Empty;
uint endRid = startRid + 1;
for (; startRid > 1; startRid--) {
uint key2;
if (!tablesStream.ReadColumn(tableSource, startRid - 1, keyColIndex, out key2))
break; // Should never happen since startRid is valid
if (key != key2)
break;
}
for (; endRid <= tableSource.Rows; endRid++) {
uint key2;
if (!tablesStream.ReadColumn(tableSource, endRid, keyColIndex, out key2))
break; // Should never happen since endRid is valid
if (key != key2)
break;
}
return new ContiguousRidList(startRid, endRid - startRid);
}
示例4: 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.IsInvalidRID(rid)) {
value = 0;
return false;
}
var cr = columnReader;
if (cr != null && cr.ReadColumn(table, rid, column, out value))
return true;
#if THREAD_SAFE
theLock.EnterWriteLock(); try {
#endif
var reader = GetReader_NoLock(table, rid);
reader.Position += column.Offset;
value = column.Read(reader);
#if THREAD_SAFE
} finally { theLock.ExitWriteLock(); }
#endif
return true;
}