Exemplo n.º 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);
        }
Exemplo n.º 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;
        }