本文整理汇总了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;
}
示例2: MethodSemanticsMetaDataTableRecordVM
public MethodSemanticsMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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]);
}
示例8: ManifestResourceMetaDataTableRecordVM
public ManifestResourceMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例9: DeclSecurityMetaDataTableRecordVM
public DeclSecurityMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例10: CustomAttributeMetaDataTableRecordVM
public CustomAttributeMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例11: ConstantMetaDataTableRecordVM
public ConstantMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例12: TypeSpecMetaDataTableRecordVM
public TypeSpecMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例13: StandAloneSigMetaDataTableRecordVM
public StandAloneSigMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例14: PropertyPtrMetaDataTableRecordVM
public PropertyPtrMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}
示例15: NestedClassMetaDataTableRecordVM
public NestedClassMetaDataTableRecordVM(MetaDataTableVM mdVM, MDToken mdToken)
: base(mdVM, mdToken)
{
}