Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16095


Ignore:
Timestamp:
08/29/18 16:45:24 (6 years ago)
Author:
jkarder
Message:

#2839: worked on hive project management

  • removed usage of null-conditional operator
Location:
branches/2839_HiveProjectManagement
Files:
3 edited

Legend:

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

    r16040 r16095  
    436436        }
    437437        treeView.Nodes.Add(ungroupedGroupNode);
    438       } else {
    439         ungroupedGroupNode?.Nodes.Clear();
     438      } else if (ungroupedGroupNode != null) {
     439        ungroupedGroupNode.Nodes.Clear();
    440440      }
    441441
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.Administrator/3.3/Views/ResourcesView.cs

    r16072 r16095  
    338338
    339339      foreach (var r in resources) {
    340         r.ParentResourceId = targetResource?.Id;
     340        r.ParentResourceId = targetResource != null ? targetResource.Id : (Guid?)null;
    341341      }
    342342
     
    381381      var resources = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IEnumerable<Resource>;
    382382      var targetNode = treeView.GetNodeAt(treeView.PointToClient(new Point(e.X, e.Y)));
    383       var targetResource = targetNode?.Tag as Resource;
     383      var targetResource = (targetNode != null ? targetNode.Tag : null) as Resource;
    384384
    385385      if (!IsAdmin()
     
    637637          n.ForeColor = offlineColor;
    638638          if (s.LastHeartbeat.HasValue)
    639             n.Text += " [" + s.LastHeartbeat?.ToString("g") + "]";
     639            n.Text += " [" + (s.LastHeartbeat != null ? s.LastHeartbeat.Value.ToString("g") : null) + "]";
    640640        }
    641641      } else {
  • branches/2839_HiveProjectManagement/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r16094 r16095  
    299299          || newIncludedResources.Contains(checkedResource)) {
    300300          e.Cancel = true;
    301           ExtractStatistics((Resource)resourcesTreeView.SelectedNode?.Tag);
     301
     302          var selectedNode = resourcesTreeView.SelectedNode;
     303          var selectedResource = (Resource)(selectedNode != null ? selectedNode.Tag : null);
     304
     305          ExtractStatistics(selectedResource);
    302306        }
    303307      }
     
    814818    public event EventHandler SelectedProjectChanged;
    815819    private void OnSelectedProjectChanged() {
    816       SelectedProjectChanged?.Invoke(this, EventArgs.Empty);
     820      var handler = SelectedProjectChanged;
     821      if (handler != null) handler(this, EventArgs.Empty);
    817822    }
    818823
    819824    public event EventHandler AssignedResourcesChanged;
    820825    private void OnAssignedResourcesChanged() {
    821       AssignedResourcesChanged?.Invoke(this, EventArgs.Empty);
     826      var handler = AssignedResourcesChanged;
     827      if (handler != null) handler(this, EventArgs.Empty);
    822828    }
    823829
    824830    public event EventHandler ProjectsTreeViewDoubleClicked;
    825831    private void OnProjectsTreeViewDoubleClicked() {
    826       ProjectsTreeViewDoubleClicked?.Invoke(this, EventArgs.Empty);
     832      var handler = ProjectsTreeViewDoubleClicked;
     833      if (handler != null) handler(this, EventArgs.Empty);
    827834    }
    828835    #endregion
Note: See TracChangeset for help on using the changeset viewer.