Exemple #1
0
    public static bool AllowsNull(this ParameterDefinition parameter, MethodDefinition method, NullGuardMode mode)
    {
        if (mode == NullGuardMode.Explicit)
        {
            return(ExplicitMode.AllowsNull(parameter, method));
        }

        return(parameter.ImplicitAllowsNull());
    }
    public static bool AllowsNull(this ParameterDefinition parameter, MethodDefinition method, ExplicitMode explicitMode)
    {
        if (explicitMode != null)
        {
            return(explicitMode.AllowsNull(parameter, method));
        }

        return(parameter.ImplicitAllowsNull());
    }
    public bool AllowsNullOutput(ParameterDefinition parameter, MethodDefinition method)
    {
        // Maintain legacy behavior in non-NRT modes which does not check ref output values
        if (!parameter.IsOut)
        {
            return(true);
        }

        return(parameter.ImplicitAllowsNull());
    }
 public bool AllowsSetMethodToAcceptNull(PropertyDefinition property, MethodDefinition setMethod, ParameterDefinition valueParameter)
 {
     return(valueParameter.ImplicitAllowsNull());
 }
 public bool AllowsNullInput(ParameterDefinition parameter, MethodDefinition method)
 {
     return(parameter.ImplicitAllowsNull());
 }