Ejemplo n.º 1
0
        /// <summary>
        /// Mark the active task as complete.
        /// </summary>
        public void MarkComplete()
        {
            TreeViewItem item = tasksTreeView.SelectedItem as TreeViewItem;
            UserTask     task = item.Header as UserTask;

            if (task.Status == UserTask.StatusPhase.Completed)
            {
                task.Status = UserTask.StatusPhase.InProgress;
            }
            else
            {
                task.Status   = UserTask.StatusPhase.Completed;
                task.Progress = 100;

                if (!_showCompleted)
                {
                    deleteTask(item, false);
                }
            }

            item.Header = new UserTask(false);
            item.Header = task;

            TaskDatabase.UpdateTask(task);
        }
Ejemplo n.º 2
0
        private void RecoverTask(UserTask task)
        {
            FlowDocument document = task.DetailsDocument;

            task.SaveChangesToDisk = true;
            task.DetailsDocument   = document;

            TaskDatabase.UpdateTask(task);
            new RecoveryDatabase(RecoveryVersion.LastRun).RecoveryTask = null;

            if (tasksView != null)
            {
                tasksView.UpdateTask(task);
            }

            TasksPeekContent.UpdateAll(task);
        }