예제 #1
0
        public ControllerMain(IModel modelMain, ViewMain viewMain, ViewAddProject viewAdd,
                              ViewEvaluation viewEvaluation)
        {
            mModelMain      = modelMain;
            mViewMain       = viewMain;
            mViewAddProject = viewAdd;
            mViewEvaluation = viewEvaluation;
            mViewMain.setController(this);
            mViewAddProject.setController(this);
            mViewEvaluation.setController(this);

            ChangeStatus(ClientStati.NotConnected);
            msgClass = new MyMessageClass(mModelMain.MyData.Number);

            //CreateChannel();
            CreateThreads();

#if TestList
            mModelMain.mProjects = new List <Project>()
            {
                new Project("12345", new TimeSpan(1, 0, 0)),
                new Project("23456", new TimeSpan(2, 0, 0)),
                new Project("34567", new TimeSpan(3, 0, 0))
            };
            mViewMain.UpdateProjects(mModelMain.mProjects);
#endif
        }
예제 #2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            IModel         _modelMain      = new ModelMain();
            ViewMain       _viewMain       = new ViewMain();
            ViewAddProject _viewAddProject = new ViewAddProject();
            ViewEvaluation _viewEvaluation = new ViewEvaluation();
            IController    cnt             = new ControllerMain(_modelMain, _viewMain, _viewAddProject, _viewEvaluation);

            Application.Run(_viewMain);
        }
예제 #3
0
        public void AddProject()
        {
            ViewAddProject addDialog = new ViewAddProject();

            addDialog.setController(this);
            if (addDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                Project projectToAdd = new Project(addDialog.projectName, addDialog.projectedTime);
                QueueMessage(msgClass.NewProjectMessage(projectToAdd));
                mModelMain.mProjects.Add(projectToAdd);
                UpdateCombobox();
            }
        }