コード例 #1
0
 void OnTaskDeleted(object sender, TaskDeletedEventArgs e)
 {
     if (e.DeletedTask.IsActive)
     {
         RefreshTasksAfterModification();
     }
 }
コード例 #2
0
 void OnTaskDeleted(object sender, TaskDeletedEventArgs e)
 {
     using (var taskVM = this.ChildTasks.FirstOrDefault(t => t.TaskId == e.DeletedTask.TaskId))
     {
         this.ChildTasks.Remove(taskVM);
     }
 }
コード例 #3
0
ファイル: TaskData.cs プロジェクト: scottharner/TaskConqueror
        /// <summary>
        /// Updates the active tasks cached query results when a task is deleted
        /// </summary>
        void ActiveTasksOnTaskDeleted(object sender, TaskDeletedEventArgs e)
        {
            QueryCacheItem cachedQuery = _appInfo.GlobalQueryCache.GetCacheItem(Constants.ActiveTasksCacheItem);

            if (cachedQuery != null)
            {
                List <Data.Task> activeTasks = (List <Data.Task>)cachedQuery.Value;
                Data.Task        deletedTask = activeTasks.FirstOrDefault(t => t.TaskID == e.DeletedTask.TaskId);
                if (deletedTask != null)
                {
                    activeTasks.Remove(deletedTask);
                    _appInfo.GlobalQueryCache.UpdateCacheItem(Constants.ActiveTasksCacheItem, activeTasks);
                }
            }
        }