Exemplo n.º 1
0
        private void MoveRightTask(Task selectedTask)
        {
            Task parent = _selectedTask.Parent;
            var  relevantParentSubTasks = TaskRepository.GetRelevantParentSubTasks(_selectedTask);
            int  index     = relevantParentSubTasks.IndexOf(_selectedTask);
            Task newParent = relevantParentSubTasks[index - 1];

            _taskViewModel.MoveSubtask(_selectedTask, newParent);
        }
Exemplo n.º 2
0
        private void ShowTaskDetails(Task task)
        {
            var control = new TaskDetailControl(task);

            InsertAndShowControl(control);
        }
Exemplo n.º 3
0
 protected virtual void OnSelectedTaskChanged(Task task)
 {
     SelectedTaskChanged?.Invoke(task);
 }
Exemplo n.º 4
0
 private void UpdateSelectedTask(Task task)
 {
     _selectedTask     = task;
     _menuContext.Task = task;
     OnSelectedTaskChanged(task);
 }
Exemplo n.º 5
0
        private void MenuItemClicked(object sender, string name)
        {
            switch (name)
            {
            case "MenuItemAdd":
                OnCreateTaskRequested();
                break;

            case "MenuItemMoveUp":
                _taskViewModel.IncreasePriority(_selectedTask);
                break;

            case "MenuItemMoveDown":
                _taskViewModel.DecreasePriority(_selectedTask);
                break;

            case "MenuItemMoveLeft":
                Task newParent = _selectedTask.Parent.Parent;
                _taskViewModel.MoveSubtask(_selectedTask, newParent);
                break;

            case "MenuItemMoveRight":
                MoveRightTask(_selectedTask);
                break;

            case "MenuItemOpen":
                _taskViewModel.OpenTask(_selectedTask);
                break;

            case "MenuItemClose":
                _taskViewModel.CompleteTask(_selectedTask);
                break;

            case "MenuItemActivate":
                _taskViewModel.ActivateTask(_selectedTask);
                break;

            case "MenuItemPause":
                _taskViewModel.OpenTask(_selectedTask);
                break;

            case "MenuItemEdit":
                InsertAndShowControl(new TaskEditControl(_taskViewModel, _selectedTask));
                break;

            case "MenuItemDelete":
                _taskViewModel.RemoveTask(_selectedTask);
                break;

            case "MenuItemShowActive":
                var actionManager = Shell.Instance.GetComponent <IActionManager>();
                actionManager.ExecuteActionGuarded <ActiveTaskWindowAction>(_lifetime);
                break;

            case "MenuItemAddSubTask":
                InsertAndShowControl(new TaskEditControl(_taskViewModel, _selectedTask, true));
                break;

            case "Backward":
                NavigateBackward();
                break;

            case "Forward":
                NavigateForward();
                break;

            case "MenuItemIconMenu":
                ShowMenuSettingsMenu();
                break;

            default:
                break;
            }
        }