Пример #1
0
 private static void SetupDatabase(SqlLiteDbIdeaAdapter sqlLiteDbIdeaAdapter,
                                   SqliteDbTodoAdapter sqliteDbTodoAdapter)
 {
     sqlLiteDbIdeaAdapter.CreateDatabase(false);
     sqlLiteDbIdeaAdapter.CreateIdeaTable();
     sqliteDbTodoAdapter.CreateTodoTable();
 }
Пример #2
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);
        }