- Timestamp:
- 07/02/18 15:51:17 (6 years ago)
- Location:
- branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3
- Files:
-
- 2 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 } -
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive/3.3/ServiceClients/HiveServiceClient.cs
r15969 r15978 75 75 76 76 public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; 77 78 77 } 79 78 … … 2461 2460 System.Collections.Generic.Dictionary<System.Guid, System.Collections.Generic.List<System.Guid>> GetProjectGenealogy(); 2462 2461 2462 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/GetProjectNames", ReplyAction="http://tempuri.org/IHiveService/GetProjectNamesResponse")] 2463 System.Collections.Generic.Dictionary<System.Guid, string> GetProjectNames(); 2464 2463 2465 [System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/IHiveService/SaveProjectPermissions", ReplyAction="http://tempuri.org/IHiveService/SaveProjectPermissionsResponse")] 2464 2466 void SaveProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading); … … 2789 2791 } 2790 2792 2793 public System.Collections.Generic.Dictionary<System.Guid, string> GetProjectNames() 2794 { 2795 return base.Channel.GetProjectNames(); 2796 } 2797 2791 2798 public void SaveProjectPermissions(System.Guid projectId, System.Collections.Generic.List<System.Guid> grantedUserIds, bool reassign, bool cascading, bool reassignCascading) 2792 2799 {
Note: See TracChangeset
for help on using the changeset viewer.