public override System.Windows.FrameworkElement Operate(AddInView.Operation op, double[] operands) { switch (op.Name) { case "Graph": return(Graph(operands)); default: throw new NotSupportedException("Can not support operation: " + op.Name); } }
public override double Operate(AddInView.Operation op, double[] operands) { switch (op.Name) { case "+": return(operands[0] + operands[1]); case "-": return(operands[0] - operands[1]); case "*": return(operands[0] * operands[1]); case "/": return(operands[0] / operands[1]); default: throw new InvalidOperationException("Can not perform operation: " + op.Name); } }
public static Calculator.Contracts.IOperationContract ViewToContractAdapter(AddInView.Operation view) { return(new OperationViewToContractAddInAdapter(view)); }
public OperationViewToContractAddInAdapter(AddInView.Operation view) { _view = view; }
public OperationViewToContractAddInAdapter(AddInView.Operation view) { _view = view; }