Ejemplo n.º 1
0
        /// <summary>
        /// Updates the all projects cached query results when a project is updated
        /// </summary>
        void AllProjectsOnProjectUpdated(object sender, ProjectUpdatedEventArgs e)
        {
            QueryCacheItem cachedQuery = _appInfo.GlobalQueryCache.GetCacheItem(Constants.AllProjectsCacheItem);

            if (cachedQuery != null)
            {
                // updated the query results if needed
                List <Data.Project> allProjects = (List <Data.Project>)cachedQuery.Value;
                Data.Project        oldProject  = allProjects.FirstOrDefault(p => p.ProjectID == e.UpdatedProject.ProjectId);
                Data.Project        newProject  = e.UpdatedDbProject;
                if (oldProject != null && newProject != null)
                {
                    allProjects.Remove(oldProject);
                    allProjects.Add(newProject);
                }
                else if (newProject != null)
                {
                    allProjects.Add(newProject);
                }

                allProjects = SortList(allProjects);

                _appInfo.GlobalQueryCache.UpdateCacheItem(Constants.AllProjectsCacheItem, allProjects);
            }
        }
Ejemplo n.º 2
0
        void OnProjectUpdated(object sender, ProjectUpdatedEventArgs e)
        {
            this.ChildProjects.Remove(this.ChildProjects.FirstOrDefault(p => p.ProjectId == e.UpdatedProject.ProjectId));
            var viewModel = new ProjectViewModel(e.UpdatedProject, _projectData, _taskData);

            this.ChildProjects.Add(viewModel);
        }
Ejemplo n.º 3
0
 void OnProjectUpdated(object sender, ProjectUpdatedEventArgs e)
 {
     RefreshProjectsAfterModification();
 }