Пример #1
0
        public void Initialize()
        {
            StreamWriter writer = new StreamWriter("../../../contestTests/Repository/testFile.txt");

            writer.WriteLine("");
            writer.Close();

            validator  = new DepartmentValidator();
            repository = new DepartmentFileRepository(validator, "../../../contestTests/Repository/testFile.txt");
        }
        static void Main()
        {
            CandidateValidator      validatorCandidate  = new CandidateValidator();
            CandidateFileRepository repositoryCandidate = new CandidateFileRepository(validatorCandidate, "../../Data/Candidates.txt");
            CandidateController     controllerCandidate = new CandidateController(repositoryCandidate);

            DepartmentValidator      validatorDepartment  = new DepartmentValidator();
            DepartmentFileRepository repositoryDepartment = new DepartmentFileRepository(validatorDepartment, "../../Data/Departments.txt");
            DepartmentController     controllerDepartment = new DepartmentController(repositoryDepartment);

            OptionValidator      validatorOption  = new OptionValidator();
            OptionFileRepository repositoryOption = new OptionFileRepository(validatorOption, "../../Data/Options.txt",
                                                                             repositoryDepartment, repositoryCandidate);
            OptionController controllerOption = new OptionController(repositoryOption);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new HomePage(
                                new CandidateView(controllerCandidate),
                                new DepartmentView(controllerDepartment),
                                new OptionView(controllerOption, controllerCandidate, controllerDepartment)));
        }
Пример #3
0
 public void Cleanup()
 {
     validator = null; repository = null;
 }