Example #1
0
        static void ExecuteOperation()
        {
            switch ((OperationNumber)operation)
            {
            case OperationNumber.PLUS:
                typeoperation = new Addition(Firstvalue, Secondvalue);
                break;

            case OperationNumber.MINUS:
                typeoperation = new Subtraction(Firstvalue, Secondvalue);
                break;

            case OperationNumber.CROSS:
                typeoperation = new Multiplication(Firstvalue, Secondvalue);
                break;

            case OperationNumber.DIVISION:
                typeoperation = new Division(Firstvalue, Secondvalue);
                break;
            }
        }
Example #2
0
 public Operations(AOperation operation)
 {
     _operation = operation;
 }