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

IsValueType() public static method

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

		return t.IsStruct || IsEnumType (t);
	}

Usage Example

Example #1
0
        void DoResolveInstanceExpression(ResolveContext ec)
        {
            //
            // Argument is another delegate
            //
            if (delegate_instance_expression != null)
            {
                return;
            }

            if (method_group.IsStatic)
            {
                delegate_instance_expression = null;
                return;
            }

            Expression instance = method_group.InstanceExpression;

            if (instance != null && instance != EmptyExpression.Null)
            {
                delegate_instance_expression = instance;
                Type instance_type = delegate_instance_expression.Type;
                if (TypeManager.IsValueType(instance_type) || TypeManager.IsGenericParameter(instance_type))
                {
                    delegate_instance_expression = new BoxedCast(
                        delegate_instance_expression, TypeManager.object_type);
                }
            }
            else
            {
                delegate_instance_expression = ec.GetThis(loc);
            }
        }
All Usage Examples Of Mono.CSharp.TypeManager::IsValueType