Exemplo n.º 1
0
        public void ArchiveCompleted()
        {
            if (!File.Exists(User.Default.ArchiveFilePath))
            {
                _window.File_Options(null, null);
            }

            if (!File.Exists(User.Default.ArchiveFilePath))
            {
                return;
            }

            var archiveList = new TaskList(User.Default.ArchiveFilePath);
            var completed   = _taskList.Tasks.Where(t => t.Completed);

            foreach (var task in completed)
            {
                archiveList.Add(task);
                _taskList.Delete(task);
            }

            UpdateDisplayedTasks();
        }