Example #1
0
        public static UserBase CreateOperate(string operate)
        {
            UserBase oper = null;

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

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

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

            case "/":
                oper = new UserDiv();
                break;
            }

            return(oper);
        }
Example #2
0
        public static UserBase CreateOperate(string operate)
        {
            UserBase oper = null;
            switch (operate)
            {
                case "+":
                    oper = new UserAdd();
                    break;
                case "-":
                    oper = new UserSub();
                    break;
                case "*":
                    oper = new UserMul();
                    break;
                case "/":
                    oper = new UserDiv();
                    break;
            }

            return oper;
        }