Exemple #1
0
 public TodoController(ILoggingController loggingController, ITodoService service, TodoFrame frame)
 {
     _loggingController     = loggingController;
     _service               = service;
     _frame                 = frame;
     _frame.FormBorderStyle = FormBorderStyle.FixedToolWindow;
     _frame.Closing        += _frame_Closing;
     CustomizePanels(_frame);
     LoadPanels();
     _loggingController.Log(MessageType.information, "TODO Board Setup");
 }
Exemple #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);
        }
Exemple #3
0
        private void CustomizePanels(TodoFrame frame)
        {
            var tableLayoutPanel = new TableLayoutPanel {
                Dock = DockStyle.Fill, RowCount = 1, ColumnCount = 3, HorizontalScroll = { Enabled = false, Visible = false }
            };

            _frame.Controls.Add(tableLayoutPanel);

            //add wrap panals (flowpanals)
            todoArea = new FlowLayoutPanel {
                Dock = DockStyle.Fill, FlowDirection = FlowDirection.TopDown, WrapContents = false, AutoScroll = false, HorizontalScroll = { Visible = false, Enabled = false }, Height = 576, BorderStyle = BorderStyle.FixedSingle, AllowDrop = true
            };
            doingArea = new FlowLayoutPanel {
                Dock = DockStyle.Fill, FlowDirection = FlowDirection.TopDown, WrapContents = false, AutoScroll = false, HorizontalScroll = { Visible = false, Enabled = false }, Height = 576, BorderStyle = BorderStyle.FixedSingle, AllowDrop = true
            };
            doneArea = new FlowLayoutPanel {
                Dock = DockStyle.Fill, FlowDirection = FlowDirection.TopDown, WrapContents = false, AutoScroll = false, Height = 576, HorizontalScroll = { Visible = false, Enabled = false }, BorderStyle = BorderStyle.FixedSingle, AllowDrop = true
            };


            todoArea.DragEnter  += TodoArea_DragEnter;
            doingArea.DragEnter += DoingArea_DragEnter;
            doneArea.DragEnter  += DoneArea_DragEnter;


            todoArea.DragDrop  += TodoArea_DragDrop;
            doingArea.DragDrop += DoingArea_DragDrop;
            doneArea.DragDrop  += DoneArea_DragDrop;

            // https://www.codeproject.com/Questions/571197/disableplustheplushorizontalplusscrollbarplusinplu
            todoArea.AutoScroll  = true;
            doingArea.AutoScroll = true;
            doneArea.AutoScroll  = true;

            var columnStyle1 = new ColumnStyle(SizeType.Percent, 30f);
            var columnStyle2 = new ColumnStyle(SizeType.Percent, 30f);
            var columnStyle3 = new ColumnStyle(SizeType.Percent, 30f);

            //var todoHeader = new Label{Text = "TODO",TextAlign = ContentAlignment.MiddleCenter, Width = 320, BackColor = Color.AntiqueWhite,Anchor = AnchorStyles.Top};
            var todoHeader = new FlowLayoutPanel {
                FlowDirection = FlowDirection.LeftToRight, WrapContents = false, Height = 20, Width = 320, BackColor = Color.AntiqueWhite
            };
            var AddButton = new Button {
                Text = "+", Width = 20, TextAlign = ContentAlignment.MiddleCenter, BackColor = Color.AntiqueWhite, Anchor = AnchorStyles.Top, Margin = Padding.Empty, FlatStyle = FlatStyle.Flat
            };

            AddButton.FlatAppearance.BorderSize = 0;
            AddButton.Click += AddButton_Click;
            todoHeader.Controls.Add(AddButton);
            todoHeader.Controls.Add(new Label {
                Text = "TODO", TextAlign = ContentAlignment.MiddleCenter, Width = 320, BackColor = Color.AntiqueWhite, Anchor = AnchorStyles.Top
            });



            var doingHeader = new Label {
                Text = "Doing", TextAlign = ContentAlignment.MiddleCenter, Width = 320, BackColor = Color.BurlyWood, Anchor = AnchorStyles.Top
            };

            var doneHeader = new Label {
                Text = "Done", TextAlign = ContentAlignment.MiddleCenter, Width = 320, BackColor = Color.Gold, Anchor = AnchorStyles.Top
            };


            tableLayoutPanel.ColumnStyles.Add(columnStyle1);
            tableLayoutPanel.ColumnStyles.Add(columnStyle2);
            tableLayoutPanel.ColumnStyles.Add(columnStyle3);

            tableLayoutPanel.Controls.Add(todoHeader, 0, 0);
            tableLayoutPanel.Controls.Add(doingHeader, 1, 0);
            tableLayoutPanel.Controls.Add(doneHeader, 2, 0);

            tableLayoutPanel.Controls.Add(todoArea, 0, 1);
            tableLayoutPanel.Controls.Add(doingArea, 1, 1);
            tableLayoutPanel.Controls.Add(doneArea, 2, 1);

            _areas.Add(PositionNames.Todo, todoArea);
            _areas.Add(PositionNames.Doing, doingArea);
            _areas.Add(PositionNames.Done, doneArea);
            _loggingController.Log(MessageType.information, "TODO Panals Setup");
        }