示例#1
0
        public override void execute()
        {
            Repository repository = new SingleProgramStateRepository(logfile);

            controller.setRepository(repository);
            controller.addProgram(statement);
            throw (new ExitTextMenuException("Program was chosen."));
        }
示例#2
0
        public static void Main(string[] args)
        {
            TextMenu   menu       = new TextMenu();
            Repository repository = new SingleProgramStateRepository("./logs/alllogs.txt");
            Controller controller = new Controller(repository);

            menu.addCommand(new ChooseProgramCommand("1", "Choose program", controller));
            menu.addCommand(new ExecuteOneStepCommand("2", "Execute one step of the current program", controller));
            menu.addCommand(new ExecuteAllStepsCommand("3", "Execute all steps of the current program", controller));
            menu.addCommand(new ExitCommand("0", "Exit"));

            menu.show();
        }