private void BuildUserInterface(NotepadFrame frame) { BuildMenu(frame.menuMain); BuildUIArea1(frame.splitControlArea.Panel1); BuildUIArea2(frame.splitControlArea.Panel2); _loggingController.Log(MessageType.information, " UI Built"); }
private static LoggingController SetupLoggingController(NotepadFrame notepadFrame) { var bottomTabs = notepadFrame.scOuter.Panel2.Controls[0]; var logTabPage = bottomTabs.Controls[0]; var loggingController = new LoggingController((TabPage)logTabPage); return(loggingController); }
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"); }
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; }
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); }
private static IdeaController SetupIdeaController(SqlLiteDbIdeaAdapter sqlLiteDbIdeaAdapter, NotepadFrame notepadFrame, ILoggingController loggingController) { var ideaRepository = new IdeaRepository(sqlLiteDbIdeaAdapter); var ideaService = new IdeaService(ideaRepository); var ideaController = new IdeaController((TabControl)notepadFrame.splitControlArea.Panel1.Controls[0], ideaService, loggingController); return(ideaController); }
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; }