- Timestamp:
- 07/02/18 15:51:17 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/HiveClient.cs
r15922 r15978 87 87 } 88 88 89 private Dictionary<Guid, string> projectNames; 90 public Dictionary<Guid, string> ProjectNames { 91 get { return projectNames; } 92 } 93 94 private HashSet<Project> disabledParentProjects; 95 public HashSet<Project> DisabledParentProjects { 96 get { return disabledParentProjects; } 97 } 89 98 90 99 private List<Plugin> onlinePlugins; … … 127 136 resources = new ItemList<Resource>(); 128 137 jobs = new HiveItemCollection<RefreshableJob>(); 138 projectNames = new Dictionary<Guid, string>(); 129 139 130 140 projectAncestors = new Dictionary<Guid, HashSet<Guid>>(); … … 138 148 service.GetSlaves().ForEach(s => resources.Add(s)); 139 149 service.GetJobs().ForEach(p => jobs.Add(new RefreshableJob(p))); 150 projectNames = service.GetProjectNames(); 140 151 }); 141 152 142 153 UpdateResourceGenealogy(); 143 154 UpdateProjectGenealogy(); 155 UpdateDisabledParentProjects(); 144 156 } 145 157 catch { … … 159 171 try { 160 172 projects = new ItemList<Project>(); 173 projectNames = new Dictionary<Guid, string>(); 161 174 resources = new ItemList<Resource>(); 162 175 … … 170 183 service.GetSlaveGroups().ForEach(g => resources.Add(g)); 171 184 service.GetSlaves().ForEach(s => resources.Add(s)); 185 projectNames = service.GetProjectNames(); 172 186 }); 173 187 174 188 UpdateResourceGenealogy(); 175 189 UpdateProjectGenealogy(); 190 UpdateDisabledParentProjects(); 176 191 } catch { 177 192 projects = null; … … 236 251 projectDescendants[ancestor].Add(pa.Key); 237 252 } 253 } 254 } 255 256 private void UpdateDisabledParentProjects() { 257 disabledParentProjects = new HashSet<Project>(); 258 259 foreach (var pid in projects 260 .Where(x => x.ParentProjectId.HasValue) 261 .SelectMany(x => projectAncestors[x.Id]).Distinct() 262 .Where(x => !projects.Select(y => y.Id).Contains(x))) { 263 var p = new Project(); 264 p.Id = pid; 265 p.ParentProjectId = projectAncestors[pid].FirstOrDefault(); 266 p.Name = projectNames[pid]; 267 disabledParentProjects.Add(p); 238 268 } 239 269 }
Note: See TracChangeset
for help on using the changeset viewer.