Mono.Cecil.MetadataImporter.ImportType C# (CSharp) Method

ImportType() public method

public ImportType ( TypeReference type, ImportGenericContext context ) : TypeReference
type TypeReference
context ImportGenericContext
return TypeReference
        public TypeReference ImportType(TypeReference type, ImportGenericContext context)
        {
            if (type.IsTypeSpecification ())
                return ImportTypeSpecification (type, context);

            var reference = new TypeReference (
                type.Namespace,
                type.Name,
                module,
                ImportScope (type.Scope),
                type.IsValueType);

            MetadataSystem.TryProcessPrimitiveTypeReference (reference);

            if (type.IsNested)
                reference.DeclaringType = ImportType (type.DeclaringType, context);

            if (type.HasGenericParameters)
                ImportGenericParameters (reference, type);

            return reference;
        }

Same methods

MetadataImporter::ImportType ( Type type, ImportGenericContext context ) : TypeReference
MetadataImporter::ImportType ( Type type, ImportGenericContext context, ImportGenericKind import_kind ) : TypeReference

Usage Example

Esempio n. 1
0
        public TypeReference Import(Type type, IGenericParameterProvider context)
        {
            CheckType(type);
            CheckContext(context, this);

            return(MetadataImporter.ImportType(
                       type,
                       GenericContextFor(context),
                       context != null ? ImportGenericKind.Open : ImportGenericKind.Definition));
        }
All Usage Examples Of Mono.Cecil.MetadataImporter::ImportType