Exemplo n.º 1
0
        private static BrandController SetupBrandController(NotepadController notepadController,
                                                            FileBrowserController fileBrowserController, IdeaController ideaController, ILoggingController loggingController, Form frame)
        {
            var brandController =
                new BrandController(notepadController, fileBrowserController, ideaController, loggingController, frame);

            notepadController.BrandController = brandController;
            return(brandController);
        }
Exemplo n.º 2
0
        private static void SetupMainController(NotepadController notepadController,
                                                FileBrowserController fileBrowserController, BrandController brandController, NotepadFrame notepadFrame,
                                                IdeaController ideaController, ILoggingController loggingController, ITodoController todoController)
        {
            var mainController = new MainController(notepadController, fileBrowserController, brandController, notepadFrame,
                                                    ideaController, todoController, loggingController);

            notepadFrame.Controller = mainController;
        }
Exemplo n.º 3
0
 public BrandController(NotepadController notepadController, FileBrowserController fileBrowserController,
                        IdeaController ideaController, ILoggingController loggingController, Form frame)
 {
     _notepadController     = notepadController;
     _fileBrowserController = fileBrowserController;
     _ideaController        = ideaController;
     _loggingController     = loggingController;
     _frame = (NotepadFrame)frame;
     SetUpIconList();
     SetIcons(true);
     ActiveBrand = Brands.Normal;
     loggingController.Log(MessageType.information, "BrandController Constructed");
 }
Exemplo n.º 4
0
 public MainController(NotepadController notepadController,
                       FileBrowserController fileBrowserController,
                       BrandController brandController,
                       NotepadFrame frame, IdeaController ideaController, ITodoController todoController,
                       ILoggingController loggingController)
 {
     _notepadController               = notepadController;
     _fileBrowserController           = fileBrowserController;
     _fileBrowserController.OpenFile += OpenFile;
     _brandController   = brandController;
     _frame             = frame;
     _ideaController    = ideaController;
     _todoController    = todoController;
     _loggingController = loggingController;
     BuildUserInterface(frame);
     _loggingController.Log(MessageType.information, "MainController constructed");
     _frame.scOuter.Panel2Collapsed = true;
 }
Exemplo n.º 5
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            var notepadFrame = new NotepadFrame();
            var todoFrame    = new TodoFrame();
            ILoggingController loggingController = SetupLoggingController(notepadFrame);
            var notepadController     = new NotepadController(notepadFrame.splitControlArea.Panel2, loggingController);
            var fileBrowserController = new FileBrowserController((TabControl)notepadFrame.splitControlArea.Panel1.Controls[0], loggingController);
            var sqlLiteDbAdapter      = new SqlLiteDbIdeaAdapter(GetConnectionString(), GetDatabaseName());
            var sqliteDbTodoAdapter   = new SqliteDbTodoAdapter(GetConnectionString(), GetDatabaseName());

            SetupDatabase(sqlLiteDbAdapter, sqliteDbTodoAdapter);
            var ideaController  = SetupIdeaController(sqlLiteDbAdapter, notepadFrame, loggingController);
            var brandController = SetupBrandController(notepadController, fileBrowserController, ideaController, loggingController, notepadFrame);
            var todoRepository  = new TodoRepository(sqliteDbTodoAdapter);
            var todoController  = new TodoController(loggingController, new TodoService(todoRepository), todoFrame);

            SetupMainController(notepadController, fileBrowserController, brandController, notepadFrame, ideaController, loggingController, todoController);

            Application.Run(notepadFrame);
        }