示例#1
0
        public void SetupCmdProcessor()
        {
            // Set up CommandProcessor and Commands
            CommandProcessor cmd = CommandProcessor.GetInstance;

            cmd.Cleanup();

            // Create and register commands
            CommandView          view     = new CommandView();
            CommandCompleteOrder complete = new CommandCompleteOrder();

            // Base Commands
            CommandChangeState cState = new CommandChangeState();
            CommandSelectTable select = new CommandSelectTable();
            CommandExit        exit   = new CommandExit();
            CommandHelp        help   = new CommandHelp();

            // Register Commands
            cmd.Register(view);
            cmd.Register(complete);
            cmd.Register(cState);
            cmd.Register(select);
            cmd.Register(help);
            cmd.Register(exit);
        }
        public void SetupCmdProcessor()
        {
            // Set up CommandProcessor and Commands
            CommandProcessor cmd = CommandProcessor.GetInstance;

            cmd.Cleanup();

            // Create and register Commands
            CommandView    viewMenu = new CommandView();
            CommandAdd     add      = new CommandAdd();
            CommandRemove  remove   = new CommandRemove();
            CommandConfirm confirm  = new CommandConfirm();

            // Base Commands
            CommandChangeState changeState = new CommandChangeState();
            CommandSelectTable select      = new CommandSelectTable();
            CommandExit        exit        = new CommandExit();
            CommandHelp        help        = new CommandHelp();

            // Register commands
            cmd.Register(help);
            cmd.Register(viewMenu);
            cmd.Register(add);
            cmd.Register(remove);
            cmd.Register(confirm);
            cmd.Register(changeState);
            cmd.Register(select);
            cmd.Register(exit);
        }