Exemplo n.º 1
0
        static void Main()
        {
            bool student = false;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Form AppView = null;

            if (student)
            {
                StartView view = new StartView();
                ShowStartController controller = new ShowStartController(view);

                AppView = view;
            }
            else
            {
                MainView view = new MainView();
                MainController maincontroller = new MainController(view);

                ListQuestionView viewQuestion = new ListQuestionView();
                ListQuestionController questionController = new ListQuestionController(viewQuestion);
                maincontroller.AddController(questionController);

                ListQuestionListView viewQuestionList = new ListQuestionListView();
                ListQuestionListController listQuestionListController = new ListQuestionListController(viewQuestionList);
                maincontroller.AddController(listQuestionListController);

                listQuestionListController.SelectedListChanged += questionController.LoadList;
                listQuestionListController.Load();

                AppView = view;
            }

            Application.Run(AppView);
        }
Exemplo n.º 2
0
 public void SetController(IController controller)
 {
     this.Controller = (ShowStartController)controller;
 }