• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# MD.ColumnInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中dnlib.DotNet.MD.ColumnInfo的典型用法代码示例。如果您正苦于以下问题:C# ColumnInfo类的具体用法?C# ColumnInfo怎么用?C# ColumnInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ColumnInfo类属于dnlib.DotNet.MD命名空间,在下文中一共展示了ColumnInfo类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CreateField

		protected override HexField CreateField(ColumnInfo colInfo) {
			if (colInfo.Index == 0)
				return CreateTypeAttributesField(colInfo, mdVM.Buffer, Name, Span.Start);
			return base.CreateField(colInfo);
		}
开发者ID:0xd4d,项目名称:dnSpy,代码行数:5,代码来源:MetaDataTableRecordVM.cs


示例2: CreateField

 protected override HexField CreateField(ColumnInfo colInfo)
 {
     if (colInfo.Index == 0) {
         var field = new UInt16FlagsHexField(mdVM.Document, Name, colInfo.Name, StartOffset + (uint)colInfo.Offset);
         field.Add(new BooleanHexBitField("NoMangle", 0));
         field.Add(new IntegerHexBitField("CharSet", 1, 2, CharSetInfos));
         field.Add(new IntegerHexBitField("BestFit", 4, 2, BestFitInfos));
         field.Add(new BooleanHexBitField("SupportsLastError", 6));
         field.Add(new IntegerHexBitField("CallConv", 8, 3, CallConvInfos));
         field.Add(new IntegerHexBitField("ThrowOnUnmappableChar", 12, 2, ThrowOnUnmappableCharInfos));
         return field;
     }
     return base.CreateField(colInfo);
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:14,代码来源:MetaDataTableRecordVM.cs


示例3: CreateAssemblyAttributesField

 internal static UInt32FlagsHexField CreateAssemblyAttributesField(ColumnInfo colInfo, HexDocument doc, string name, ulong startOffset)
 {
     var field = new UInt32FlagsHexField(doc, name, colInfo.Name, startOffset + (uint)colInfo.Offset);
     field.Add(new BooleanHexBitField("PublicKey", 0));
     field.Add(new IntegerHexBitField("Processor Arch", 4, 3, PAInfos));
     field.Add(new BooleanHexBitField("Processor Arch Specified", 7));
     field.Add(new BooleanHexBitField("Retargetable", 8));
     field.Add(new IntegerHexBitField("ContentType", 9, 3, ContentTypeInfos));
     field.Add(new BooleanHexBitField("DisableJITcompileOptimizer", 14));
     field.Add(new BooleanHexBitField("EnableJITcompileTracking", 15));
     return field;
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:12,代码来源:MetaDataTableRecordVM.cs


示例4: CreateGenericParamAttributesField

 internal static UInt16FlagsHexField CreateGenericParamAttributesField(ColumnInfo colInfo, HexDocument doc, string name, ulong startOffset)
 {
     var field = new UInt16FlagsHexField(doc, name, colInfo.Name, startOffset + (uint)colInfo.Offset);
     field.Add(new IntegerHexBitField("Variance", 0, 2, VarianceInfos));
     field.Add(new BooleanHexBitField("Reference", 2));
     field.Add(new BooleanHexBitField("Struct", 3));
     field.Add(new BooleanHexBitField("Default ctor", 4));
     return field;
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:9,代码来源:MetaDataTableRecordVM.cs


示例5: CreateField

 protected override HexField CreateField(ColumnInfo colInfo)
 {
     if (colInfo.Index == 0)
         return CreateTypeAttributesField(colInfo, doc, Name, startOffset);
     return base.CreateField(colInfo);
 }
开发者ID:johnjohnsp1,项目名称:dnSpy,代码行数:6,代码来源:MetaDataTableRecordVM.cs


示例6: 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


示例7: GetCodedTokenDescription

        string GetCodedTokenDescription(CodedToken codedToken, string codedTokenName, ColumnInfo col, HexField field)
        {
            MDToken token;
            if (!codedToken.Decode(ReadFieldValue(field), out token))
                return string.Empty;

            return string.Format("{0} Coded Token: {1}[{2}] (0x{3:X8})", codedTokenName, token.Table, token.Rid, token.Raw);
        }
开发者ID:johnjohnsp1,项目名称:dnSpy,代码行数:8,代码来源:MetaDataTableRecordVM.cs


示例8: 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


示例9: GetDescription

		static object GetDescription(IMetaData metadata, MDTable table, ColumnInfo column, uint rowValue) {
			if (ColumnSize.Module <= column.ColumnSize && column.ColumnSize <= ColumnSize.GenericParamConstraint) {
				Table targetTable = (Table)(column.ColumnSize - ColumnSize.Module);

				if (rowValue == 0)
					return "";
				return new MDToken(targetTable, rowValue).ToDescription();
			}
			if (ColumnSize.TypeDefOrRef <= column.ColumnSize && column.ColumnSize <= ColumnSize.TypeOrMethodDef) {
				CodedToken info;
				switch (column.ColumnSize) {
					case ColumnSize.TypeDefOrRef:
						info = CodedToken.TypeDefOrRef;
						break;
					case ColumnSize.HasConstant:
						info = CodedToken.HasConstant;
						break;
					case ColumnSize.HasCustomAttribute:
						info = CodedToken.HasCustomAttribute;
						break;
					case ColumnSize.HasFieldMarshal:
						info = CodedToken.HasFieldMarshal;
						break;
					case ColumnSize.HasDeclSecurity:
						info = CodedToken.HasDeclSecurity;
						break;
					case ColumnSize.MemberRefParent:
						info = CodedToken.MemberRefParent;
						break;
					case ColumnSize.HasSemantic:
						info = CodedToken.HasSemantic;
						break;
					case ColumnSize.MethodDefOrRef:
						info = CodedToken.MethodDefOrRef;
						break;
					case ColumnSize.MemberForwarded:
						info = CodedToken.MemberForwarded;
						break;
					case ColumnSize.Implementation:
						info = CodedToken.Implementation;
						break;
					case ColumnSize.CustomAttributeType:
						info = CodedToken.CustomAttributeType;
						break;
					case ColumnSize.ResolutionScope:
						info = CodedToken.ResolutionScope;
						break;
					case ColumnSize.TypeOrMethodDef:
						info = CodedToken.TypeOrMethodDef;
						break;
					default:
						throw new InvalidOperationException(string.Format("Invalid ColumnSize: {0}", column.ColumnSize));
				}

				MDToken decodedToken;
				if (!info.Decode(rowValue, out decodedToken))
					return InvalidValue;

				if (decodedToken.Rid == 0)
					return "";
				return decodedToken.ToDescription();
			}
			if (column.ColumnSize == ColumnSize.Strings) {
				if (rowValue == 0)
					return "";

				var value = metadata.StringsStream.Read(rowValue);
				if (value == (UTF8String)null)
					return InvalidValue;
				return value;
			}
			if (column.ColumnSize == ColumnSize.Blob) {
				if (rowValue == 0)
					return "";

				if (!metadata.BlobStream.IsValidOffset(rowValue))
					return InvalidValue;

				var reader = metadata.BlobStream.GetClonedImageStream();
				reader.Position = rowValue;
				return reader.ReadCompressedUInt32();
			}
			if (column.ColumnSize == ColumnSize.GUID) {
				if (rowValue == 0)
					return "";

				var value = metadata.GuidStream.Read(rowValue);
				if (value == null)
					return InvalidValue;
				return value.Value.ToString("D");
			}
			return GetLiteralDescription(table.Table, column, rowValue);
		}
开发者ID:mamingxiu,项目名称:dnExplorer,代码行数:93,代码来源:RowInfoPopulator.cs


示例10: GetLiteralDescription

		static string GetLiteralDescription(Table table, ColumnInfo column, uint rowValue) {
			object enumValue = null;
			switch (table) {
				case Table.TypeDef:
					if (column.Name == "Flags")
						enumValue = (TypeAttributes)rowValue;
					break;

				case Table.Field:
					if (column.Name == "Flags")
						enumValue = (FieldAttributes)rowValue;
					break;

				case Table.Method:
					if (column.Name == "ImplFlags")
						enumValue = (MethodImplAttributes)rowValue;
					else if (column.Name == "Flags")
						enumValue = (MethodAttributes)rowValue;
					break;

				case Table.Param:
					if (column.Name == "Flags")
						enumValue = (ParamAttributes)rowValue;
					break;

				case Table.Constant:
					if (column.Name == "Type")
						enumValue = (ElementType)rowValue;
					break;

				case Table.DeclSecurity:
					if (column.Name == "Action")
						enumValue = (SecurityAction)rowValue;
					break;

				case Table.Event:
					if (column.Name == "EventFlags")
						enumValue = (EventAttributes)rowValue;
					break;

				case Table.Property:
					if (column.Name == "Flags")
						enumValue = (PropertyAttributes)rowValue;
					break;

				case Table.MethodSemantics:
					if (column.Name == "Semantic")
						enumValue = (MethodSemanticsAttributes)rowValue;
					break;

				case Table.ImplMap:
					if (column.Name == "MappingFlags")
						enumValue = (PInvokeAttributes)rowValue;
					break;

				case Table.Assembly:
					if (column.Name == "HashAlgId")
						enumValue = (AssemblyHashAlgorithm)rowValue;
					else if (column.Name == "Flags")
						enumValue = (AssemblyAttributes)rowValue;
					break;

				case Table.AssemblyRef:
					if (column.Name == "Flags")
						enumValue = (AssemblyAttributes)rowValue;
					break;

				case Table.File:
					if (column.Name == "Flags")
						enumValue = (FileAttributes)rowValue;
					break;

				case Table.ExportedType:
					if (column.Name == "Flags")
						enumValue = (TypeAttributes)rowValue;
					break;

				case Table.ManifestResource:
					if (column.Name == "Flags")
						enumValue = (ManifestResourceAttributes)rowValue;
					break;

				case Table.GenericParam:
					if (column.Name == "Flags")
						enumValue = (GenericParamAttributes)rowValue;
					break;
			}


			if (enumValue == null)
				return "";
			return enumValue.ToString();
		}
开发者ID:mamingxiu,项目名称:dnExplorer,代码行数:93,代码来源:RowInfoPopulator.cs


示例11: CreateTypeAttributesField

 internal static UInt32FlagsHexField CreateTypeAttributesField(ColumnInfo colInfo, HexDocument doc, string name, ulong startOffset)
 {
     var field = new UInt32FlagsHexField(doc, name, colInfo.Name, startOffset + (uint)colInfo.Offset);
     field.Add(new IntegerHexBitField("Visibility", 0, 3, VisibilityInfos));
     field.Add(new IntegerHexBitField("Layout", 3, 2, LayoutInfos));
     field.Add(new IntegerHexBitField("Semantics", 5, 1, SemanticsInfos));
     field.Add(new BooleanHexBitField("Abstract", 7));
     field.Add(new BooleanHexBitField("Sealed", 8));
     field.Add(new BooleanHexBitField("SpecialName", 10));
     field.Add(new BooleanHexBitField("RTSpecialName", 11));
     field.Add(new BooleanHexBitField("Import", 12));
     field.Add(new BooleanHexBitField("Serializable", 13));
     field.Add(new BooleanHexBitField("WindowsRuntime", 14));
     field.Add(new IntegerHexBitField("String", 16, 2, StringFormatInfos));
     field.Add(new BooleanHexBitField("HasSecurity", 18));
     field.Add(new BooleanHexBitField("BeforeFieldInit", 20));
     field.Add(new BooleanHexBitField("Forwarder", 21));
     field.Add(new IntegerHexBitField("Custom", 22, 2, CustomFormatInfos));
     return field;
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:20,代码来源:MetaDataTableRecordVM.cs


示例12: ReadFieldValue

		uint ReadFieldValue(HexDocument doc, ColumnInfo col) {
			ulong start = StartOffset + (ulong)col.Offset;
			if (col.Size == 2)
				return doc.ReadUInt16(start);
			else if (col.Size == 4)
				return doc.ReadUInt32(start);
			throw new InvalidOperationException();
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:8,代码来源:MetaDataTableRecordTreeNode.cs


示例13: GetCodedTokenDescription

        string GetCodedTokenDescription(CodedToken codedToken, string codedTokenName, ColumnInfo col, HexField field)
        {
            MDToken token;
            if (!codedToken.Decode(ReadFieldValue(field), out token))
                return string.Format("Invalid {0} Coded Token", codedTokenName);

            var info = GetInfo(token.Table, token.Rid);
            if (string.IsNullOrEmpty(info))
                return string.Format("{0}: {1}[{2}], 0x{3:X8})", codedTokenName, token.Table, token.Rid, token.Raw);
            return string.Format("{0} ({1}: {2}[{3}], 0x{4:X8})", info, codedTokenName, token.Table, token.Rid, token.Raw);
        }
开发者ID:4058665,项目名称:dnSpy,代码行数:11,代码来源:MetaDataTableRecordVM.cs


示例14: ReadFieldValue

		uint ReadFieldValue(HexBuffer buffer, ColumnInfo col) {
			var start = Span.Start + (ulong)col.Offset;
			if (col.Size == 2)
				return buffer.ReadUInt16(start);
			else if (col.Size == 4)
				return buffer.ReadUInt32(start);
			throw new InvalidOperationException();
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:MetaDataTableRecordNode.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MD.MDTable类代码示例发布时间:2022-05-26
下一篇:
C# Emit.OpCode类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap