Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
 public static Calculator.Contracts.IOperationContract ViewToContractAdapter(AddInView.Operation view)
 {
     return(new OperationViewToContractAddInAdapter(view));
 }
Ejemplo n.º 4
0
 public OperationViewToContractAddInAdapter(AddInView.Operation view)
 {
     _view = view;
 }
 public OperationViewToContractAddInAdapter(AddInView.Operation view)
 {
     _view = view;
 }