Mono.Cecil.Mixin.IsTypeSpecification C# (CSharp) Method

IsTypeSpecification() public static method

public static IsTypeSpecification ( this type ) : bool
type this
return bool
        public static bool IsTypeSpecification(this TypeReference type)
        {
            switch (type.etype) {
            case ElementType.Array:
            case ElementType.ByRef:
            case ElementType.CModOpt:
            case ElementType.CModReqD:
            case ElementType.FnPtr:
            case ElementType.GenericInst:
            case ElementType.MVar:
            case ElementType.Pinned:
            case ElementType.Ptr:
            case ElementType.SzArray:
            case ElementType.Sentinel:
            case ElementType.Var:
                return true;
            }

            return false;
        }

Usage Example

Esempio n. 1
0
        public TypeReference ImportType(TypeReference type, IGenericContext context)
        {
            if (Mixin.IsTypeSpecification(type))
            {
                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);
        }
All Usage Examples Of Mono.Cecil.Mixin::IsTypeSpecification