public CSParameterList And(string type, string identifier, CSParameterKind parameterKind = CSParameterKind.None, CSConstant defaultValue = null) { return(And(new CSParameter(new CSSimpleType(Exceptions.ThrowOnNull(type, nameof(type))), new CSIdentifier(Exceptions.ThrowOnNull(identifier, nameof(identifier))), parameterKind, defaultValue))); }
public CSParameter(CSType type, CSIdentifier name, CSParameterKind parameterKind = CSParameterKind.None, CSConstant defaultValue = null) { CSType = Exceptions.ThrowOnNull(type, nameof(type)); Name = Exceptions.ThrowOnNull(name, nameof(name)); ParameterKind = parameterKind; DefaultValue = defaultValue; }
static string ToParameterKindString(CSParameterKind parameterKind) { switch (parameterKind) { case CSParameterKind.None: return(""); case CSParameterKind.Out: return("out"); case CSParameterKind.Ref: return("ref"); case CSParameterKind.This: return("this"); case CSParameterKind.Params: return("params"); default: throw new ArgumentOutOfRangeException(nameof(parameterKind), "unexpected parameter kind " + parameterKind.ToString()); } }
public CSParameter(string type, string name, CSParameterKind parameterKind = CSParameterKind.None, CSConstant defaultValue = null) : this(new CSSimpleType(type), new CSIdentifier(name), parameterKind, defaultValue) { }