/// <summary> /// Выполнить заданную операцию /// </summary> public dynamic SetOperation(out string oper) { int operation = GetOperation(); dynamic res = 0; oper = string.Empty; switch (operation) { case 1: res = Add.Invoke(_val1, _val2); oper = "+"; break; case 2: res = Subtr.Invoke(_val1, _val2); oper = "-"; break; case 3: res = Mult.Invoke(_val1, _val2); oper = "*"; break; case 4: res = Div.Invoke(_val1, _val2); oper = "/"; break; } return(res); }
private string calculate(OperationDelegate callback) { return(callback.Invoke(val1, val2)); }