ImportGenericParameter() static private method

static private ImportGenericParameter ( Type type, ImportGenericContext context ) : TypeReference
type System.Type
context ImportGenericContext
return TypeReference
示例#1
0
 private TypeReference ImportTypeSpecification(Type type, ImportGenericContext context)
 {
     if (type.IsByRef)
     {
         return(new ByReferenceType(this.ImportType(type.GetElementType(), context)));
     }
     if (type.IsPointer)
     {
         return(new PointerType(this.ImportType(type.GetElementType(), context)));
     }
     if (type.IsArray)
     {
         return(new ArrayType(this.ImportType(type.GetElementType(), context), type.GetArrayRank()));
     }
     if (type.IsGenericType)
     {
         return(this.ImportGenericInstance(type, context));
     }
     if (!type.IsGenericParameter)
     {
         throw new NotSupportedException(type.FullName);
     }
     return(MetadataImporter.ImportGenericParameter(type, context));
 }