Ignore:
Timestamp:
04/26/18 16:33:53 (19 months ago)
Author:
jzenisek
Message:

#2839:

  • replaced use of TreeView with NoDoubleClickTreeView everywhere allegedly reasonable for Hive
  • updated genealogy computation for HiveAdminClient and corresponding views (ResourcesView & ProjectResourcesView)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r15920 r15922  
    289289          if(project.Name.ToLower().Contains(currentSearchString.ToLower())) {
    290290            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)));
    292292          }
    293293        }
     
    448448    private void UpdateNewAssignedResources() {
    449449      for(int i = newAssignedResources.Count-1; i>=0; i--) {
    450         if(newAssignedResources.Intersect(HiveClient.Instance.GetAvailableParentResources(newAssignedResources.ElementAt(i).Id)).Any()) {
     450        if(newAssignedResources.Intersect(HiveClient.Instance.GetAvailableResourceAncestors(newAssignedResources.ElementAt(i).Id)).Any()) {
    451451          newAssignedResources.Remove(newAssignedResources.ElementAt(i));
    452452        }
     
    460460      if (JobId != Guid.Empty) {
    461461        foreach (var item in assignedResources) {
    462           foreach (var descendant in HiveClient.Instance.GetAvailableChildResources(item.Id)) {
     462          foreach (var descendant in HiveClient.Instance.GetAvailableResourceDescendants(item.Id)) {
    463463            includedResources.Add(descendant);
    464464          }
     
    467467
    468468      foreach (var item in newAssignedResources) {
    469         foreach (var descendant in HiveClient.Instance.GetAvailableChildResources(item.Id)) {
     469        foreach (var descendant in HiveClient.Instance.GetAvailableResourceDescendants(item.Id)) {
    470470          newIncludedResources.Add(descendant);
    471471        }
     
    476476      newIncludedResources.Clear();
    477477      foreach (var item in newAssignedResources) {
    478         foreach (var descendant in HiveClient.Instance.GetAvailableChildResources(item.Id)) {
     478        foreach (var descendant in HiveClient.Instance.GetAvailableResourceDescendants(item.Id)) {
    479479          newIncludedResources.Add(descendant);
    480480        }
     
    598598        Resource r = (Resource)n.Tag;
    599599        if(n.Nodes.Count > 0) {
    600           if(HiveClient.Instance.GetAvailableChildResources(r.Id).OfType<SlaveGroup>().Any()
    601             || HiveClient.Instance.GetAvailableChildResources(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()) {
    602602            n.Expand();
    603603            ExpandResourceNodesOfInterest(n.Nodes);
     
    615615
    616616      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();
    624622      }
    625623    }
     
    628626      HashSet<Slave> newAssignedSlaves = new HashSet<Slave>(newAssignedResources.OfType<Slave>());
    629627      foreach (var slaveGroup in newAssignedResources.OfType<SlaveGroup>()) {
    630         foreach (var slave in HiveClient.Instance.GetAvailableChildResources(slaveGroup.Id).OfType<Slave>()) {
     628        foreach (var slave in HiveClient.Instance.GetAvailableResourceDescendants(slaveGroup.Id).OfType<Slave>()) {
    631629          newAssignedSlaves.Add(slave);
    632630        }
     
    638636        var slaveGroup = resource as SlaveGroup;
    639637        if (slaveGroup != null) {
    640           selectedSlaves = new HashSet<Slave>(HiveClient.Instance.GetAvailableChildResources(slaveGroup.Id).OfType<Slave>());
     638          selectedSlaves = new HashSet<Slave>(HiveClient.Instance.GetAvailableResourceDescendants(slaveGroup.Id).OfType<Slave>());
    641639        } else {
    642640          selectedSlaves = new HashSet<Slave>(new[] { resource as Slave });
Note: See TracChangeset for help on using the changeset viewer.