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


C# MDToken类代码示例

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


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

示例1: ArgumentException

		unsafe void IMetaDataImport.GetMethodProps(uint mb, uint* pClass, ushort* szMethod, uint cchMethod, uint* pchMethod, uint* pdwAttr, IntPtr* ppvSigBlob, uint* pcbSigBlob, uint* pulCodeRVA, uint* pdwImplFlags) {
			if ((mb >> 24) != 0x06)
				throw new ArgumentException();
			var method = tokenToMethodDef[mb];
			var row = metaData.TablesHeap.MethodTable[mb & 0x00FFFFFF];

			if (pClass != null)
				*pClass = new MDToken(MD.Table.TypeDef, metaData.GetRid(method.DeclaringType)).Raw;
			if (pdwAttr != null)
				*pdwAttr = row.Flags;
			if (ppvSigBlob != null)
				*ppvSigBlob = IntPtr.Zero;
			if (pcbSigBlob != null)
				*pcbSigBlob = 0;
			if (pulCodeRVA != null)
				*pulCodeRVA = row.RVA;
			if (pdwImplFlags != null)
				*pdwImplFlags = row.ImplFlags;

			string name = method.Name.String ?? string.Empty;
			int len = (int)Math.Min((uint)name.Length + 1, cchMethod);
			if (szMethod != null) {
				for (int i = 0; i < len - 1; i++, szMethod++)
					*szMethod = (ushort)name[i];
				if (len > 0)
					*szMethod = 0;
			}
			if (pchMethod != null)
				*pchMethod = (uint)len;
		}
开发者ID:xingkongtianyu,项目名称:Protect.NET,代码行数:30,代码来源:MDEmitter.cs

示例2: MethodSemanticsMetaDataTableRecordVM

 public MethodSemanticsMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例3: GetEventOwnerRid

		public unsafe static uint GetEventOwnerRid(IMetaDataImport mdi, uint token) {
			if (mdi == null)
				return 0;
			if (IsGlobal(mdi, token))
				return 1;
			uint ownerToken;
			int hr = mdi.GetEventProps(token, new IntPtr(&ownerToken), IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero);
			if (hr != 0)
				return 0;
			var ownerMdToken = new MDToken(ownerToken);
			return ownerMdToken.Table == Table.TypeDef ? ownerMdToken.Rid : 0;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:12,代码来源:MDAPI.cs

示例4: GetGenericParamOwner

		public unsafe static uint GetGenericParamOwner(IMetaDataImport2 mdi2, uint token) {
			if (mdi2 == null)
				return 0;
			uint ownerToken;
			int hr = mdi2.GetGenericParamProps(token, IntPtr.Zero, IntPtr.Zero, new IntPtr(&ownerToken), IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero);
			if (hr != 0)
				return 0;
			var ownerMdToken = new MDToken(ownerToken);
			return ownerMdToken.Table == Table.TypeDef || ownerMdToken.Table == Table.Method ? ownerMdToken.Raw : 0;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:MDAPI.cs

示例5: GetInterfaceImplOwnerRid

		public unsafe static uint GetInterfaceImplOwnerRid(IMetaDataImport mdi, uint token) {
			if (mdi == null)
				return 0;

			uint ownerToken;
			int hr = mdi.GetInterfaceImplProps(token, new IntPtr(&ownerToken), IntPtr.Zero);
			var ownerMdToken = new MDToken(ownerToken);
			return ownerMdToken.Table == Table.TypeDef ? ownerMdToken.Rid : 0;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:MDAPI.cs

示例6: Encode

		/// <summary>
		/// Encodes a token
		/// </summary>
		/// <param name="token">The token</param>
		/// <param name="codedToken">Coded token</param>
		/// <returns><c>true</c> if successful</returns>
		public bool Encode(MDToken token, out uint codedToken) {
			return Encode(token.Raw, out codedToken);
		}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:9,代码来源:CodedToken.cs

示例7: MetaDataTableRecordVM

 protected MetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM.Owner)
 {
     this.mdVM = mdVM;
     this.mdToken = mdToken;
     this.hexFields = new HexField[mdVM.TableInfo.Columns.Count];
     for (int i = 0; i < this.hexFields.Length; i++)
         this.hexFields[i] = CreateField(mdVM.TableInfo.Columns[i]);
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:9,代码来源:MetaDataTableRecordVM.cs

示例8: ManifestResourceMetaDataTableRecordVM

 public ManifestResourceMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例9: DeclSecurityMetaDataTableRecordVM

 public DeclSecurityMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例10: CustomAttributeMetaDataTableRecordVM

 public CustomAttributeMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例11: ConstantMetaDataTableRecordVM

 public ConstantMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例12: TypeSpecMetaDataTableRecordVM

 public TypeSpecMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例13: StandAloneSigMetaDataTableRecordVM

 public StandAloneSigMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例14: PropertyPtrMetaDataTableRecordVM

 public PropertyPtrMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs

示例15: NestedClassMetaDataTableRecordVM

 public NestedClassMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
     : base(mdVM, mdToken)
 {
 }
开发者ID:4058665,项目名称:dnSpy,代码行数:4,代码来源:MetaDataTableRecordVM.cs


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