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


C# IMetaDataImport.GetTypeDefProps方法代码示例

本文整理汇总了C#中IMetaDataImport.GetTypeDefProps方法的典型用法代码示例。如果您正苦于以下问题:C# IMetaDataImport.GetTypeDefProps方法的具体用法?C# IMetaDataImport.GetTypeDefProps怎么用?C# IMetaDataImport.GetTypeDefProps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMetaDataImport的用法示例。


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

示例1: GetTypeDefAttributes

		public static unsafe TypeAttributes? GetTypeDefAttributes(IMetaDataImport mdi, uint token) {
			uint dwTypeDefFlags;
			int hr = mdi.GetTypeDefProps(token, IntPtr.Zero, 0, IntPtr.Zero, new IntPtr(&dwTypeDefFlags), IntPtr.Zero);
			return hr == 0 ? (TypeAttributes)dwTypeDefFlags : (TypeAttributes?)null;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:5,代码来源:MDAPI.cs

示例2: GetTypeDefEnclosingType

		public static unsafe uint GetTypeDefEnclosingType(IMetaDataImport mdi, uint token) {
			if (mdi == null)
				return 0;
			uint dwTypeDefFlags;
			int hr = mdi.GetTypeDefProps(token, IntPtr.Zero, 0, IntPtr.Zero, new IntPtr(&dwTypeDefFlags), IntPtr.Zero);
			if (hr != 0)
				return 0;

			if ((dwTypeDefFlags & 7) >= 2) {
				uint enclType;
				hr = mdi.GetNestedClassProps(token, out enclType);
				if (hr == 0)
					return enclType;
			}

			return 0;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:17,代码来源:MDAPI.cs

示例3: GetTypeDefExtends

		public unsafe static uint GetTypeDefExtends(IMetaDataImport mdi, uint token) {
			uint tkExtends;
			int hr = mdi.GetTypeDefProps(token, IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, new IntPtr(&tkExtends));
			return hr != 0 ? 0 : tkExtends;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:5,代码来源:MDAPI.cs

示例4: GetTypeDefName

		public static unsafe string GetTypeDefName(IMetaDataImport mdi, uint token) {
			if (mdi == null)
				return null;
			uint chTypeDef;
			char[] nameBuf = null;
			int hr = mdi.GetTypeDefProps(token, IntPtr.Zero, 0, new IntPtr(&chTypeDef), IntPtr.Zero, IntPtr.Zero);
			if (hr >= 0 && chTypeDef != 0) {
				nameBuf = new char[chTypeDef];
				fixed (char* p = &nameBuf[0])
					hr = mdi.GetTypeDefProps(token, new IntPtr(p), (uint)nameBuf.Length, new IntPtr(&chTypeDef), IntPtr.Zero, IntPtr.Zero);
			}
			if (hr < 0)
				return null;

			if (chTypeDef <= 1)
				return string.Empty;
			return new string(nameBuf, 0, (int)chTypeDef - 1);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:18,代码来源:MDAPI.cs

示例5: GetTypeDefExtends

		static uint GetTypeDefExtends(IMetaDataImport mdi, uint token) {
			uint chTypeDef, dwTypeDefFlags, tkExtends;
			int hr = mdi.GetTypeDefProps(token, IntPtr.Zero, 0, out chTypeDef, out dwTypeDefFlags, out tkExtends);
			return hr < 0 ? 0 : tkExtends;
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:5,代码来源:MetaDataUtils.cs

示例6: GetTypeDefName

		static unsafe string GetTypeDefName(IMetaDataImport mdi, uint token, out uint enclType) {
			enclType = 0;
			if (mdi == null)
				return null;
			uint chTypeDef, dwTypeDefFlags, tkExtends;
			char[] nameBuf = null;
			int hr = mdi.GetTypeDefProps(token, IntPtr.Zero, 0, out chTypeDef, out dwTypeDefFlags, out tkExtends);
			if (hr >= 0 && chTypeDef != 0) {
				nameBuf = new char[chTypeDef];
				fixed (char* p = &nameBuf[0])
					hr = mdi.GetTypeDefProps(token, new IntPtr(p), (uint)nameBuf.Length, out chTypeDef, out dwTypeDefFlags, out tkExtends);
			}
			if (hr < 0)
				return null;

			if ((dwTypeDefFlags & 7) >= 2) {
				hr = mdi.GetNestedClassProps(token, out enclType);
				if (hr < 0)
					enclType = 0;
			}

			if (chTypeDef <= 1)
				return string.Empty;
			return new string(nameBuf, 0, (int)chTypeDef - 1);
		}
开发者ID:nakijun,项目名称:dnSpy,代码行数:25,代码来源:MetaDataUtils.cs

示例7: ClassGetProps

        public static uint ClassGetProps(IMetaDataImport mdi, uint tk)
        {
            uint dwFlags;

            mdi.GetTypeDefProps(tk, IntPtr.Zero, 0, IntPtr.Zero, (IntPtr)(&dwFlags), IntPtr.Zero);

            return dwFlags;
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:8,代码来源:MetaDataImportInterface.cs

示例8: ClassGetName

        public static string ClassGetName(IMetaDataImport mdi, uint tk)
        {
            uint chName;

            mdi.GetTypeDefProps(tk, IntPtr.Zero, 0, (IntPtr)(&chName), IntPtr.Zero, IntPtr.Zero);

            char* szName = stackalloc char[(int)chName];

            mdi.GetTypeDefProps(tk, (IntPtr)szName, chName, (IntPtr)(&chName), IntPtr.Zero, IntPtr.Zero);
            return new string(szName);
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:11,代码来源:MetaDataImportInterface.cs

示例9: ClassDerivesFrom

        private static string ClassDerivesFrom(IMetaDataImport mdi, uint tk)
        {
            uint tkExtends;
            string name = null;

            mdi.GetTypeDefProps(tk, IntPtr.Zero, 0, IntPtr.Zero, IntPtr.Zero, (IntPtr)(&tkExtends));
            if (!IsTokenNil(tkExtends))
            {
                if (TypeFromToken(tkExtends) == (uint)CorTokenType.mdtTypeDef)
                {
                    name = ClassGetName(mdi, tkExtends);
                }
                else
                {
                    uint chName;

                    mdi.GetTypeRefProps(tkExtends, IntPtr.Zero, IntPtr.Zero, 0, (IntPtr)(&chName));

                    char* szName = stackalloc char[(int)chName];

                    mdi.GetTypeRefProps(tkExtends, IntPtr.Zero, (IntPtr)szName, chName, (IntPtr)(&chName));
                    name = new string(szName);
                }
            }

            return name;
        }
开发者ID:aura1213,项目名称:netmf-interpreter,代码行数:27,代码来源:MetaDataImportInterface.cs


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