示例#1
0
        public static Operation CreateOperation(string oper)
        {
            Operation operation = null;

            switch (oper)
            {
            case "+":
                operation = new OperationAdd();
                break;

            case "-":
                operation = new OperationSub();
                break;

            case "*":
                operation = new OperationMult();
                break;

            case "/":
                operation = new OperationDivision();
                break;

            default:
                break;
            }
            return(operation);
        }
示例#2
0
        public static Operation createOperate(string operate)
        {
            Operation oper = null;

            switch (operate)
            {
            case "+":
                oper = new OperationAdd();
                break;

            case "-":
                oper = new OperationSub();
                break;

            case "*":
                oper = new OperationMul();
                break;

            case "/":
                oper = new OperationDiv();
                break;

            default:
                break;
            }
            return(oper);
        }
示例#3
0
        public static Operation CreateOperate(string type)
        {
            Operation oper = null;

            switch (type)
            {
            case "+":
                oper = new OperationAdd();
                break;

            case "-":
                oper = new OperationSub();
                break;

            default:
                break;
            }
            return(oper);
        }