private object evaluateParameter(OpuxlArgumentAttribute attr, object value) { object result = value; if (attr.Optional && (value is ExcelMissing || value is ExcelEmpty)) { // if the attribute is optional and the value is Missing, then we can just return null as the client knows how to handle that result = null; } return(result); }
private Func <object, object> MakeDelegate(string delegateName, OpuxlArgumentAttribute argument1) { Func <object, object> callback = (a) => { return(executeDelegate(delegateName, new List <object> { evaluateParameter(argument1, a) })); }; return(callback); }
private Func <object, object, object, object, object, object, object, object, object, object, object> MakeDelegate(string delegateName, OpuxlArgumentAttribute argument1, OpuxlArgumentAttribute argument2, OpuxlArgumentAttribute argument3, OpuxlArgumentAttribute argument4, OpuxlArgumentAttribute argument5, OpuxlArgumentAttribute argument6, OpuxlArgumentAttribute argument7, OpuxlArgumentAttribute argument8, OpuxlArgumentAttribute argument9, OpuxlArgumentAttribute argument10) { Func <object, object, object, object, object, object, object, object, object, object, object> callback = (a, b, c, d, e, f, g, h, i, j) => { return(executeDelegate(delegateName, new List <object> { evaluateParameter(argument1, a), evaluateParameter(argument2, b), evaluateParameter(argument3, c), evaluateParameter(argument4, d), evaluateParameter(argument5, e), evaluateParameter(argument6, f), evaluateParameter(argument7, g), evaluateParameter(argument8, h), evaluateParameter(argument9, i), evaluateParameter(argument10, j) })); }; return(callback); }
private Func <object, object, object, object, object, object> MakeDelegate(string delegateName, OpuxlArgumentAttribute argument1, OpuxlArgumentAttribute argument2, OpuxlArgumentAttribute argument3, OpuxlArgumentAttribute argument4, OpuxlArgumentAttribute argument5) { Func <object, object, object, object, object, object> callback = (a, b, c, d, e) => { return(executeDelegate(delegateName, new List <object> { evaluateParameter(argument1, a), evaluateParameter(argument2, b), evaluateParameter(argument3, c), evaluateParameter(argument4, d), evaluateParameter(argument5, e) })); }; return(callback); }