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

IsGenericInstance() static private method

static private IsGenericInstance ( Type type ) : bool
type System.Type
return bool
        static bool IsGenericInstance(Type type)
        {
            return type.IsGenericType && !type.IsGenericTypeDefinition;
        }

Usage Example

Esempio n. 1
0
        public FieldReference ImportField(FieldInfo field, ImportGenericContext context)
        {
            FieldReference fieldReference;
            TypeReference  typeReference = this.ImportType(field.DeclaringType, context);

            if (MetadataImporter.IsGenericInstance(field.DeclaringType))
            {
                field = MetadataImporter.ResolveFieldDefinition(field);
            }
            context.Push(typeReference);
            try
            {
                fieldReference = new FieldReference()
                {
                    Name          = field.Name,
                    DeclaringType = typeReference,
                    FieldType     = this.ImportType(field.FieldType, context)
                };
            }
            finally
            {
                context.Pop();
            }
            return(fieldReference);
        }
All Usage Examples Of Mono.Cecil.MetadataImporter::IsGenericInstance