Mono.CSharp.TypeManager.IsReferenceType C# (CSharp) Method

IsReferenceType() public static method

public static IsReferenceType ( System.TypeSpec t ) : bool
t System.TypeSpec
return bool
	public static bool IsReferenceType (TypeSpec t)
	{
		if (t.IsGenericParameter)
			return ((TypeParameterSpec) t).IsReferenceType;

		return !t.IsStruct && !IsEnumType (t);
	}			
		

Usage Example

Example #1
0
        bool CanBeVolatile()
        {
            if (TypeManager.IsReferenceType(MemberType))
            {
                return(true);
            }

            switch (MemberType.BuiltinType)
            {
            case BuiltinTypeSpec.Type.Bool:
            case BuiltinTypeSpec.Type.Char:
            case BuiltinTypeSpec.Type.SByte:
            case BuiltinTypeSpec.Type.Byte:
            case BuiltinTypeSpec.Type.Short:
            case BuiltinTypeSpec.Type.UShort:
            case BuiltinTypeSpec.Type.Int:
            case BuiltinTypeSpec.Type.UInt:
            case BuiltinTypeSpec.Type.Float:
            case BuiltinTypeSpec.Type.UIntPtr:
            case BuiltinTypeSpec.Type.IntPtr:
                return(true);
            }

            if (MemberType.IsEnum)
            {
                return(true);
            }

            return(false);
        }
All Usage Examples Of Mono.CSharp.TypeManager::IsReferenceType