Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11079


Ignore:
Timestamp:
07/03/14 11:38:40 (10 years ago)
Author:
ascheibe
Message:

#2117 implemented review comments:

  • fixed updating of enabled state in Hive menu items
  • fixed casts in RefreshableHiveJobView
  • fixed cloning call
  • removed hiveTaskFound variable
Location:
trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/CreateHiveJobMenuItem.cs

    r10170 r11079  
    4848          Type contentType = content.GetType();
    4949          ToolStripItem.Enabled = ItemTask.IsTypeSupported(contentType);
    50         } else {
    51           ToolStripItem.Enabled = false;
     50          return;
    5251        }
    5352      }
     53      ToolStripItem.Enabled = false;
    5454    }
    5555
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/RunInHiveMenuItem.cs

    r10170 r11079  
    5050          Type contentType = content.GetType();
    5151          ToolStripItem.Enabled = ItemTask.IsTypeSupported(contentType);
    52         } else {
    53           ToolStripItem.Enabled = false;
     52          return;
    5453        }
    5554      }
     55      ToolStripItem.Enabled = false;
    5656    }
    5757
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r10150 r11079  
    468468    private void jobsTreeView_DragEnter(object sender, DragEventArgs e) {
    469469      e.Effect = DragDropEffects.None;
    470       var obj = e.Data.GetData(Constants.DragDropDataFormat) as IDeepCloneable;
     470      var obj = (IDeepCloneable)e.Data.GetData(Constants.DragDropDataFormat);
     471
    471472      Type objType = obj.GetType();
    472 
    473       var hiveTaskFound = ItemTask.IsTypeSupported(objType);
    474       if (hiveTaskFound) {
     473      if (ItemTask.IsTypeSupported(objType)) {
    475474        if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None;
    476475        else if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     
    481480    private void jobsTreeView_DragDrop(object sender, DragEventArgs e) {
    482481      if (e.Effect != DragDropEffects.None) {
    483         var obj = e.Data.GetData(Constants.DragDropDataFormat) as IItem;
     482        var obj = (IItem)e.Data.GetData(Constants.DragDropDataFormat);
    484483
    485484        IItem newObj = null;
    486485        if (e.Effect.HasFlag(DragDropEffects.Copy)) {
    487           newObj = obj.Clone(new Cloner()) as IItem;
     486          newObj = (IItem)obj.Clone();
    488487        } else {
    489488          newObj = obj;
     
    495494        }
    496495        if (newObj is IExecutable) {
    497           IExecutable exec = newObj as IExecutable;
     496          IExecutable exec = (IExecutable)newObj;
    498497          if (exec.ExecutionState != ExecutionState.Prepared) {
    499498            exec.Prepare();
Note: See TracChangeset for help on using the changeset viewer.