Ignore:
Timestamp:
02/12/18 18:10:42 (21 months ago)
Author:
jzenisek
Message:

#2839

  • minor changes regarding project- & resource selection
  • adapted DeleteOnNull rules in dbml
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ProjectResourcesView.cs

    r15658 r15760  
    5050    private readonly Dictionary<Guid, HashSet<Resource>> resourceDescendants = new Dictionary<Guid, HashSet<Resource>>();
    5151
    52     //private readonly Color addedAssignmentColor = Color.FromArgb(255, 0, 174, 179); // #00aeb3
    5352    private readonly Color addedAssignmentColor = Color.FromArgb(255, 87, 191, 193); // #57bfc1
    5453    private readonly Color removedAssignmentColor = Color.FromArgb(255, 236, 159, 72); // #ec9f48
     
    8483        var top = BuildResourceTree(HiveAdminClient.Instance.Resources);
    8584        detailsViewHost.Content = top;
    86         detailsViewHost.ActiveView.Locked = true;
    87       }
    88     }
    89 
     85      }
     86    }
     87
     88    protected override void SetEnabledStateOfControls() {
     89      base.SetEnabledStateOfControls();
     90      bool enabled = Content != null && !Locked && !ReadOnly;
     91
     92      inheritButton.Enabled = enabled;
     93      saveButton.Enabled = enabled;
     94      treeView.Enabled = enabled;
     95    }
    9096    #endregion
    9197
     
    208214      var resources = HiveAdminClient.Instance.Resources;
    209215
    210       foreach(var r in resources) {
     216      foreach(var r in resources.Where(x => x.Id != Guid.Empty)) {
    211217        resourceAncestors.Add(r.Id, new HashSet<Resource>());
    212218        resourceDescendants.Add(r.Id, new HashSet<Resource>());
    213219      }
    214220
    215       foreach(var r in resources) {
     221      foreach(var r in resources.Where(x => x.Id != Guid.Empty)) {
    216222        var parentResourceId = r.ParentResourceId;
    217223        while(parentResourceId != null) {
     
    253259      treeView.AfterCheck -= treeView_AfterCheck;
    254260
     261      resources = resources.Where(x => x.Id != Guid.Empty);
    255262      var mainResources = new HashSet<Resource>(resources.OfType<SlaveGroup>().Where(x => x.ParentResourceId == null));
    256263      var parentedMainResources = new HashSet<Resource>(resources.OfType<SlaveGroup>()
     
    379386      var projects = HiveAdminClient.Instance.Projects;
    380387
    381       foreach(var p in projects) {
     388      foreach(var p in projects.Where(x => x.Id != Guid.Empty)) {
    382389        projectAncestors.Add(p.Id, new HashSet<Project>());
    383390        projectDescendants.Add(p.Id, new HashSet<Project>());
    384391      }
    385392
    386       foreach (var p in projects) {
     393      foreach (var p in projects.Where(x => x.Id != Guid.Empty)) {
    387394        var parentProjectId = p.ParentProjectId;
    388395        while (parentProjectId != null) {
Note: See TracChangeset for help on using the changeset viewer.