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


C# TypeDefinitionHandle.GetTypeDefinition方法代码示例

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


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

示例1: RuntimeInspectionOnlyNamedType

        protected RuntimeInspectionOnlyNamedType(MetadataReader reader, TypeDefinitionHandle typeDefinitionHandle)
            : base()
        {
#if DEBUG
            if (!(this.InternalViolatesTypeIdentityRules))
            {
                RuntimeTypeHandle runtimeTypeHandle;
                if (ReflectionCoreExecution.ExecutionEnvironment.TryGetNamedTypeForMetadata(reader, typeDefinitionHandle, out runtimeTypeHandle))
                    Debug.Assert(false, "Type identity violation: You must use a RuntimeEENamedType to represent this type as RH has generated an EEType for it.");
            }
#endif
            _reader = reader;
            _typeDefinitionHandle = typeDefinitionHandle;
            _typeDefinition = _typeDefinitionHandle.GetTypeDefinition(_reader);
        }
开发者ID:huamichaelchen,项目名称:corert,代码行数:15,代码来源:RuntimeInspectionOnlyNamedType.cs

示例2: GetTypeFullNameFromTypeDef

        private static String GetTypeFullNameFromTypeDef(TypeDefinitionHandle typeDefinitionHandle, MetadataReader reader, List<int> genericParameterOffsets)
        {
            String s = "";

            TypeDefinition typeDefinition = typeDefinitionHandle.GetTypeDefinition(reader);
            s = typeDefinition.Name.GetString(reader);

            TypeDefinitionHandle enclosingTypeDefHandle = typeDefinition.EnclosingType;
            if (!enclosingTypeDefHandle.IsNull(reader))
            {
                String containingTypeName = GetTypeFullNameFromTypeDef(enclosingTypeDefHandle, reader, genericParameterOffsets);
                s = containingTypeName + "." + s;
            }
            else
            {
                NamespaceDefinitionHandle namespaceHandle = typeDefinition.NamespaceDefinition;
                for (; ;)
                {
                    NamespaceDefinition namespaceDefinition = namespaceHandle.GetNamespaceDefinition(reader);
                    String namespacePart = namespaceDefinition.Name.GetStringOrNull(reader);
                    if (namespacePart == null)
                        break; // Reached the root namespace.
                    s = namespacePart + "." + s;
                    if (namespaceDefinition.ParentScopeOrNamespace.HandleType != HandleType.NamespaceDefinition)
                        break; // Should have reached the root namespace first but this helper is for ToString() - better to
                    // return partial information than crash.
                    namespaceHandle = namespaceDefinition.ParentScopeOrNamespace.ToNamespaceDefinitionHandle(reader);
                }
            }
            return ConvertBackTickNameToNameWithReducerInputFormat(s, genericParameterOffsets);
        }
开发者ID:noahfalk,项目名称:corert,代码行数:31,代码来源:DiagnosticMappingTables.cs

示例3: GetPsuedoCustomAttributes

 public sealed override IEnumerable<CustomAttributeData> GetPsuedoCustomAttributes(MetadataReader reader, TypeDefinitionHandle typeDefinitionHandle)
 {
     TypeAttributes attributes = typeDefinitionHandle.GetTypeDefinition(reader).Flags;
     if (0 != (attributes & TypeAttributes.Import))
         yield return ReflectionCoreExecution.ExecutionDomain.GetCustomAttributeData(typeof(ComImportAttribute), null, null);
 }
开发者ID:huamichaelchen,项目名称:corert,代码行数:6,代码来源:ExecutionEnvironmentImplementation.Runtime.cs


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