Changeset 15922 for branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views
- Timestamp:
- 04/26/18 16:33:53 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs
r15920 r15922 289 289 if(project.Name.ToLower().Contains(currentSearchString.ToLower())) { 290 290 filteredProjects.Add(project); 291 filteredProjects.UnionWith(Content.Where(p => HiveClient.Instance. ProjectAncestors[project.Id].Contains(p.Id)));291 filteredProjects.UnionWith(Content.Where(p => HiveClient.Instance.GetAvailableProjectAncestors(project.Id).Select(x => x.Id).Contains(p.Id))); 292 292 } 293 293 } … … 448 448 private void UpdateNewAssignedResources() { 449 449 for(int i = newAssignedResources.Count-1; i>=0; i--) { 450 if(newAssignedResources.Intersect(HiveClient.Instance.GetAvailable ParentResources(newAssignedResources.ElementAt(i).Id)).Any()) {450 if(newAssignedResources.Intersect(HiveClient.Instance.GetAvailableResourceAncestors(newAssignedResources.ElementAt(i).Id)).Any()) { 451 451 newAssignedResources.Remove(newAssignedResources.ElementAt(i)); 452 452 } … … 460 460 if (JobId != Guid.Empty) { 461 461 foreach (var item in assignedResources) { 462 foreach (var descendant in HiveClient.Instance.GetAvailable ChildResources(item.Id)) {462 foreach (var descendant in HiveClient.Instance.GetAvailableResourceDescendants(item.Id)) { 463 463 includedResources.Add(descendant); 464 464 } … … 467 467 468 468 foreach (var item in newAssignedResources) { 469 foreach (var descendant in HiveClient.Instance.GetAvailable ChildResources(item.Id)) {469 foreach (var descendant in HiveClient.Instance.GetAvailableResourceDescendants(item.Id)) { 470 470 newIncludedResources.Add(descendant); 471 471 } … … 476 476 newIncludedResources.Clear(); 477 477 foreach (var item in newAssignedResources) { 478 foreach (var descendant in HiveClient.Instance.GetAvailable ChildResources(item.Id)) {478 foreach (var descendant in HiveClient.Instance.GetAvailableResourceDescendants(item.Id)) { 479 479 newIncludedResources.Add(descendant); 480 480 } … … 598 598 Resource r = (Resource)n.Tag; 599 599 if(n.Nodes.Count > 0) { 600 if(HiveClient.Instance.GetAvailable ChildResources(r.Id).OfType<SlaveGroup>().Any()601 || HiveClient.Instance.GetAvailable ChildResources(r.Id).OfType<Slave>().Intersect(assignedResources.Union(newAssignedResources)).Any()) {600 if(HiveClient.Instance.GetAvailableResourceDescendants(r.Id).OfType<SlaveGroup>().Any() 601 || HiveClient.Instance.GetAvailableResourceDescendants(r.Id).OfType<Slave>().Intersect(assignedResources.Union(newAssignedResources)).Any()) { 602 602 n.Expand(); 603 603 ExpandResourceNodesOfInterest(n.Nodes); … … 615 615 616 616 Resource r = (Resource)tn.Tag; 617 if (HiveClient.Instance.ResourceDescendants.ContainsKey(r.Id)) { 618 if (HiveClient.Instance.GetAvailableChildResources(r.Id).OfType<SlaveGroup>().Any()) { 619 tn.Expand(); 620 foreach (TreeNode n in tn.Nodes) CollapseSlaveOnlyNodes(n); 621 } else { 622 tn.Collapse(); 623 } 617 if (HiveClient.Instance.GetAvailableResourceDescendants(r.Id).OfType<SlaveGroup>().Any()) { 618 tn.Expand(); 619 foreach (TreeNode n in tn.Nodes) CollapseSlaveOnlyNodes(n); 620 } else { 621 tn.Collapse(); 624 622 } 625 623 } … … 628 626 HashSet<Slave> newAssignedSlaves = new HashSet<Slave>(newAssignedResources.OfType<Slave>()); 629 627 foreach (var slaveGroup in newAssignedResources.OfType<SlaveGroup>()) { 630 foreach (var slave in HiveClient.Instance.GetAvailable ChildResources(slaveGroup.Id).OfType<Slave>()) {628 foreach (var slave in HiveClient.Instance.GetAvailableResourceDescendants(slaveGroup.Id).OfType<Slave>()) { 631 629 newAssignedSlaves.Add(slave); 632 630 } … … 638 636 var slaveGroup = resource as SlaveGroup; 639 637 if (slaveGroup != null) { 640 selectedSlaves = new HashSet<Slave>(HiveClient.Instance.GetAvailable ChildResources(slaveGroup.Id).OfType<Slave>());638 selectedSlaves = new HashSet<Slave>(HiveClient.Instance.GetAvailableResourceDescendants(slaveGroup.Id).OfType<Slave>()); 641 639 } else { 642 640 selectedSlaves = new HashSet<Slave>(new[] { resource as Slave });
Note: See TracChangeset
for help on using the changeset viewer.