当前位置: 首页>>代码示例>>C#>>正文


C# MDTable.IsInvalidRID方法代码示例

本文整理汇总了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
 }
开发者ID:NSentinel,项目名称:dnlib,代码行数:37,代码来源:MetaData.cs

示例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;
		}
开发者ID:KitoHo,项目名称:Reflexil,代码行数:21,代码来源:TablesStream_Read.cs

示例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);
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:29,代码来源:MetaData.cs

示例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;
		}
开发者ID:KitoHo,项目名称:Reflexil,代码行数:27,代码来源:TablesStream_Read.cs


注:本文中的dnlib.DotNet.MD.MDTable.IsInvalidRID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。