IsNestedType() static private method

static private IsNestedType ( Type type ) : bool
type System.Type
return bool
Esempio n. 1
0
        public TypeReference ImportType(Type type, ImportGenericContext context, ImportGenericKind import_kind)
        {
            if (MetadataImporter.IsTypeSpecification(type) || MetadataImporter.ImportOpenGenericType(type, import_kind))
            {
                return(this.ImportTypeSpecification(type, context));
            }
            TypeReference typeReference = new TypeReference(string.Empty, type.Name, this.module, this.ImportScope(type.Assembly), type.IsValueType)
            {
                etype = MetadataImporter.ImportElementType(type)
            };

            if (!MetadataImporter.IsNestedType(type))
            {
                typeReference.Namespace = type.Namespace ?? string.Empty;
            }
            else
            {
                typeReference.DeclaringType = this.ImportType(type.DeclaringType, context, import_kind);
            }
            if (type.IsGenericType)
            {
                MetadataImporter.ImportGenericParameters(typeReference, type.GetGenericArguments());
            }
            return(typeReference);
        }
Esempio n. 2
0
 private static string NormalizeTypeFullName(Type type)
 {
     if (!MetadataImporter.IsNestedType(type))
     {
         return(type.FullName);
     }
     return(string.Concat(MetadataImporter.NormalizeTypeFullName(type.DeclaringType), "/", type.Name));
 }