예제 #1
0
파일: Program.cs 프로젝트: slieser/sandbox
        public static void Main() {
            var boardUi = new BoardUI();
            var interactors = new Interactors();
            var sync = new Synchronizer<IEnumerable<Task>>();

            // Start
            var columns_and_tasks = interactors.Start();
            boardUi.Setup_Board(columns_and_tasks);

            // Refresh
            sync.Result += tasks => boardUi.Set_Tasks(tasks);
            interactors.Refresh(tasks => sync.Process(tasks));

            // Create Task
            boardUi.Create_Task += text => {
                var task = interactors.Create_Task(text);
                boardUi.Add_Task(task);
            };

            // Show Task
            boardUi.Show_Task += (column, position) => {
                var text = interactors.Show_Task(column, position);
                boardUi.Display_Text(text);
            };

            // Move Task
            boardUi.Move_Task += (column, position, direction) => {
                var tasks_and_selectedTask = interactors.Move_Task(column, position, direction);
                boardUi.Set_Tasks(tasks_and_selectedTask.Item1, tasks_and_selectedTask.Item2);
            };

            var app = new Application { MainWindow = boardUi };
            app.Run(boardUi);
        }
예제 #2
0
파일: Program.cs 프로젝트: slieser/sandbox2
        public static void Main() {
            var boardUi = new BoardUI();
            var interactors = new Interactors();

            // Start
            var headers = interactors.Start();
            boardUi.Setup_Board(headers);

            // Create Task
            boardUi.Create_Task += text => {
                var task = interactors.Create_Task(text);
                boardUi.Add_Task(task);
            };

            var app = new Application { MainWindow = boardUi };
            app.Run(boardUi);
        }