コード例 #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);
        }
コード例 #4
0
        public static Operation CreateOperation(string operate)
        {
            Operation ret = null;

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

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

            default:
                break;
            }
            return(ret);
        }