Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/18/14 12:35:00 (10 years ago)
Author:
ascheibe
Message:

reverted last commit

Location:
branches/HiveStatistics/sources
Files:
2 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ExtensionMethods/TreeNodeExtensions.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj

    r11202 r11203  
    9898    <Compile Include="ExtensionMethods\TreeNodeExtensions.cs" />
    9999    <Compile Include="ListViewItemDateComparer.cs" />
    100     <Compile Include="MenuItems\CreateHiveJobMenuItem.cs" />
    101     <Compile Include="MenuItems\RunInHiveMenuItem.cs" />
    102100    <Compile Include="Plugin.cs" />
    103101    <Compile Include="Views\HiveJobManagerView.cs">
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/ListViewItemDateComparer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3131  public class ListViewItemDateComparer : IComparer {
    3232    private int col;
    33     public SortOrder Order { get; set; }
     33    private SortOrder order;
    3434
    3535    public ListViewItemDateComparer() {
    3636      col = 0;
    37       Order = SortOrder.Ascending;
     37      order = SortOrder.Ascending;
    3838    }
    3939
    4040    public ListViewItemDateComparer(int column, SortOrder order) {
    4141      col = column;
    42       Order = order;
     42      this.order = order;
    4343    }
    4444
     
    6666      }
    6767
    68       if (Order == SortOrder.Descending) {
     68      if (order == SortOrder.Descending) {
    6969        // invert the value returned by Compare.
    7070        returnVal *= -1;
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/MenuItems/JobManagerMenuItem.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2222using System.Collections.Generic;
    2323using System.Windows.Forms;
     24using HeuristicLab.Clients.Hive;
    2425using HeuristicLab.MainForm;
    25 using HeuristicLab.Optimizer;
    2626
    27 namespace HeuristicLab.Clients.Hive.JobManager {
     27namespace HeuristicLab.Optimizer.MenuItems {
    2828  public class JobManagerMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
    2929    public override string Name {
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Plugin.cs.frame

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    2323
    2424namespace HeuristicLab.Clients.Hive.JobManager {
    25   [Plugin("HeuristicLab.Clients.Hive.JobManager", "3.3.10.$WCREV$")]
     25  [Plugin("HeuristicLab.Clients.Hive.JobManager", "3.3.7.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Clients.Hive.JobManager-3.3.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.Clients.Hive", "3.3")]
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Properties/AssemblyInfo.cs.frame

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3232[assembly: AssemblyCompany("HEAL")]
    3333[assembly: AssemblyProduct("HeuristicLab")]
    34 [assembly: AssemblyCopyright("(c) 2002-2014 HEAL")]
     34[assembly: AssemblyCopyright("(c) 2002-2012 HEAL")]
    3535[assembly: AssemblyTrademark("")]
    3636[assembly: AssemblyCulture("")]
     
    5555// [assembly: AssemblyVersion("1.0.*")]
    5656[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.10.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.7.$WCREV$")]
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.Designer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobManagerView.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.Designer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionListView.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.Designer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveJobPermissionView.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.Designer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelector.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4242    private ISet<TreeNode> filteredTreeNodes;
    4343    private ISet<TreeNode> nodeStore;
    44    
     44    private Progress progress;
     45    private ProgressView progressView;
     46
    4547    private ISet<Resource> selectedResources;
    4648    public ISet<Resource> SelectedResources {
     
    6264      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.MonitorLarge);
    6365      imageList.Images.Add(HeuristicLab.Common.Resources.VSImageLibrary.NetworkCenterLarge);
    64     }
    65  
     66      progress = new Progress() {
     67        CanBeCanceled = false,
     68        ProgressState = ProgressState.Finished
     69      };
     70    }
     71
     72    protected override void DeregisterContentEvents() {
     73      if (progressView != null) {
     74        progressView.Content = null;
     75        progressView.Dispose();
     76        progressView = null;
     77      }
     78      base.DeregisterContentEvents();
     79    }
     80
     81    protected override void RegisterContentEvents() {
     82      base.RegisterContentEvents();
     83      progressView = new ProgressView(this, progress);
     84    }
     85
    6686    public void StartProgressView() {
    6787      if (InvokeRequired) {
    6888        Invoke(new Action(StartProgressView));
    6989      } else {
    70         var message = "Downloading resources. Please be patient.";
    71         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
     90        progress.Status = "Downloading resources. Please be patient.";
     91        progress.ProgressState = ProgressState.Started;
    7292      }
    7393    }
     
    7797        Invoke(new Action(FinishProgressView));
    7898      } else {
    79         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     99        progress.Finish();
    80100      }
    81101    }
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.Designer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/HiveResourceSelectorDialog.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.Designer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobListView.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    3434  [Content(typeof(ItemCollection<RefreshableJob>), false)]
    3535  public partial class RefreshableHiveJobListView : HeuristicLab.Core.Views.ItemCollectionView<RefreshableJob> {
     36    private Progress progress;
     37    private ProgressView progressView;
     38
    3639    public RefreshableHiveJobListView() {
    3740      InitializeComponent();
     
    4144      this.itemsListView.Columns.Add(new ColumnHeader("Date") { Text = "Date" });
    4245      this.itemsListView.Columns.Add(new ColumnHeader("Name") { Text = "Name" });
    43 
     46      foreach (ColumnHeader c in this.itemsListView.Columns) {
     47        c.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
     48      }
    4449      this.itemsListView.HeaderStyle = ColumnHeaderStyle.Clickable;
    4550      this.itemsListView.FullRowSelect = true;
    4651
    4752      this.itemsListView.ListViewItemSorter = new ListViewItemDateComparer(0, SortOrder.Ascending);
    48     }
    49 
    50     protected override void SortItemsListView(SortOrder sortOrder) {
    51       if (itemsListView.Sorting == sortOrder || sortOrder == SortOrder.None) return;
    52       ((ListViewItemDateComparer)itemsListView.ListViewItemSorter).Order = sortOrder;
    53       itemsListView.Sorting = sortOrder;
    54       itemsListView.Sort();
    55       AdjustListViewColumnSizes();
     53      this.itemsListView.Sorting = SortOrder.Ascending;
     54      this.itemsListView.Sort();
     55
     56      progress = new Progress() {
     57        CanBeCanceled = false,
     58        ProgressState = ProgressState.Finished
     59      };
     60      progressView = new ProgressView(this, progress);
    5661    }
    5762
     
    109114
    110115        task.ContinueWith((t) => {
    111           MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     116          progress.Finish();
    112117          ErrorHandling.ShowErrorDialog("An error occured while deleting the job. ", t.Exception);
    113118        }, TaskContinuationOptions.OnlyOnFaulted);
     
    120125
    121126    private void DeleteHiveJobsAsync(object items) {
    122       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Deleting job...");
     127      progress.Status = "Deleting job...";
     128      progress.ProgressState = ProgressState.Started;
     129      progress.ProgressValue = 0.0;
    123130      foreach (RefreshableJob item in (List<RefreshableJob>)items) {
    124131        Content.Remove(item);
    125132      }
    126       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     133      progress.Finish();
    127134    }
    128135
     
    216223      if (disposing) {
    217224        if (components != null) components.Dispose();
     225        progressView.Content = null;
     226        progressView.Dispose();
    218227      }
    219228      base.Dispose(disposing);
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
  • branches/HiveStatistics/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r11202 r11203  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    4242  [Content(typeof(RefreshableJob), true)]
    4343  public partial class RefreshableHiveJobView : HeuristicLab.Core.Views.ItemView {
     44    private Progress progress;
     45    private ProgressView progressView;
    4446    private HiveResourceSelectorDialog hiveResourceSelectorDialog;
    4547    private bool SuppressEvents { get; set; }
     
    5658    public RefreshableHiveJobView() {
    5759      InitializeComponent();
     60      progress = new Progress() {
     61        CanBeCanceled = false,
     62        ProgressState = ProgressState.Finished
     63      };
    5864    }
    5965
     
    6672      Content.ExceptionOccured += new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured);
    6773      Content.StateLogListChanged += new EventHandler(Content_StateLogListChanged);
     74      Content.IsProgressingChanged += new EventHandler(Content_IsProgressingChanged);
    6875      Content.HiveTasksChanged += new EventHandler(Content_HiveTasksChanged);
    6976      Content.ExecutionStateChanged += new EventHandler(Content_ExecutionStateChanged);
     
    7178      Content.Loaded += new EventHandler(Content_Loaded);
    7279      Content.TaskReceived += new EventHandler(Content_TaskReceived);
    73       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, Content.Progress);
     80      progressView = new ProgressView(this, progress);
    7481    }
    7582
     
    8188      Content.ExceptionOccured -= new EventHandler<EventArgs<Exception>>(Content_ExceptionOccured);
    8289      Content.StateLogListChanged -= new EventHandler(Content_StateLogListChanged);
     90      Content.IsProgressingChanged -= new EventHandler(Content_IsProgressingChanged);
    8391      Content.HiveTasksChanged -= new EventHandler(Content_HiveTasksChanged);
    8492      Content.ExecutionStateChanged -= new EventHandler(Content_ExecutionStateChanged);
     
    8694      Content.Loaded -= new EventHandler(Content_Loaded);
    8795      Content.TaskReceived -= new EventHandler(Content_TaskReceived);
    88       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this, false);
     96      if (progressView != null) {
     97        progressView.Content = null;
     98        progressView.Dispose();
     99        progressView = null;
     100      }
    89101      DeregisterHiveExperimentEvents();
    90102      DeregisterHiveTasksEvents();
     
    147159      Content_HiveExperimentChanged(this, EventArgs.Empty);
    148160      Content_HiveTasksChanged(this, EventArgs.Empty);
     161      Content_IsProgressingChanged(this, EventArgs.Empty);
    149162      Content_StateLogListChanged(this, EventArgs.Empty);
    150163      HiveExperiment_PropertyChanged(this, new PropertyChangedEventArgs("Id"));
     
    247260        SetEnabledStateOfControls();
    248261    }
    249 
     262    private void Content_Prepared(object sender, EventArgs e) {
     263      if (InvokeRequired)
     264        Invoke(new EventHandler(Content_Prepared), sender, e);
     265      else {
     266        nameTextBox.Enabled = true;
     267        Locked = false;
     268        SetEnabledStateOfControls();
     269      }
     270    }
     271    private void Content_Started(object sender, EventArgs e) {
     272      if (InvokeRequired)
     273        Invoke(new EventHandler(Content_Started), sender, e);
     274      else {
     275        nameTextBox.Enabled = false;
     276        SetEnabledStateOfControls();
     277      }
     278    }
     279    private void Content_Paused(object sender, EventArgs e) {
     280      if (InvokeRequired)
     281        Invoke(new EventHandler(Content_Paused), sender, e);
     282      else {
     283        nameTextBox.Enabled = true;
     284        SetEnabledStateOfControls();
     285      }
     286    }
     287    private void Content_Stopped(object sender, EventArgs e) {
     288      if (InvokeRequired)
     289        Invoke(new EventHandler(Content_Stopped), sender, e);
     290      else {
     291        nameTextBox.Enabled = true;
     292        Locked = false;
     293        SetEnabledStateOfControls();
     294      }
     295    }
    250296    private void Content_ExecutionTimeChanged(object sender, EventArgs e) {
    251297      if (InvokeRequired)
     
    280326        runCollectionViewHost.Content = GetAllRunsFromJob(Content);
    281327      }
    282       if (InvokeRequired) {
    283         Invoke(new Action(() => { isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged; }));
    284       } else {
    285         isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;
    286       }
     328      isPrivilegedCheckBox.Checked = Content.Job.IsPrivileged;
    287329    }
    288330
     
    290332      if (Content != null && Content.Job != null) {
    291333        RegisterHiveExperimentEvents();
     334        Content_IsProgressingChanged(sender, e);
    292335      }
    293336    }
     
    363406        var task = System.Threading.Tasks.Task.Factory.StartNew(ResumeJobAsync, Content);
    364407        task.ContinueWith((t) => {
    365           Content.Progress.Finish();
     408          progress.Finish();
    366409          MessageBox.Show("An error occured resuming the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
    367410          Content.Log.LogException(t.Exception);
     
    375418      var task = System.Threading.Tasks.Task.Factory.StartNew(PauseJobAsync, Content);
    376419      task.ContinueWith((t) => {
    377         Content.Progress.Finish();
     420        progress.Finish();
    378421        MessageBox.Show("An error occured pausing the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
    379422        Content.Log.LogException(t.Exception);
     
    384427      var task = System.Threading.Tasks.Task.Factory.StartNew(StopJobAsync, Content);
    385428      task.ContinueWith((t) => {
    386         Content.Progress.Finish();
     429        progress.Finish();
    387430        MessageBox.Show("An error occured stopping the job. See the log for more information.", "HeuristicLab Hive Job Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
    388431        Content.Log.LogException(t.Exception);
     
    392435
    393436    private void PauseJobAsync(object job) {
    394       Content.Progress.Start("Pausing job...");
     437      progress.Status = "Pausing job...";
     438      progress.ProgressState = ProgressState.Started;
    395439      HiveClient.PauseJob((RefreshableJob)job);
    396       Content.Progress.Finish();
     440      progress.Finish();
    397441    }
    398442
    399443    private void StopJobAsync(object job) {
    400       Content.Progress.Start("Stopping job...");
     444      progress.Status = "Stopping job...";
     445      progress.ProgressState = ProgressState.Started;
    401446      HiveClient.StopJob((RefreshableJob)job);
    402       Content.Progress.Finish();
     447      progress.Finish();
    403448    }
    404449
    405450    private void ResumeJobAsync(object job) {
    406       Content.Progress.Start("Resuming job...");
     451      progress.Status = "Resuming job...";
     452      progress.ProgressState = ProgressState.Started;
    407453      HiveClient.ResumeJob((RefreshableJob)job);
    408       Content.Progress.Finish();
     454      progress.Finish();
    409455    }
    410456
     
    461507    #endregion
    462508
     509    #region Progress reporting
     510    private void Content_IsProgressingChanged(object sender, EventArgs e) {
     511      if (this.InvokeRequired) {
     512        Invoke(new EventHandler(Content_IsProgressingChanged), sender, e);
     513      } else {
     514        if (Content != null && Content.Progress != null && Content.IsProgressing) {
     515          progressView.Content = Content.Progress;
     516        } else if (Content != null) {
     517          progressView.Content = progress;
     518        }
     519      }
     520    }
     521    #endregion
     522
    463523    #region Drag & Drop
    464524    private void jobsTreeView_DragOver(object sender, DragEventArgs e) {
     
    468528    private void jobsTreeView_DragEnter(object sender, DragEventArgs e) {
    469529      e.Effect = DragDropEffects.None;
    470       var obj = (IDeepCloneable)e.Data.GetData(Constants.DragDropDataFormat);
    471 
    472       Type objType = obj.GetType();
    473       if (ItemTask.IsTypeSupported(objType)) {
     530      var obj = e.Data.GetData(Constants.DragDropDataFormat);
     531      if (obj is IOptimizer) {
    474532        if (Content.Id != Guid.Empty) e.Effect = DragDropEffects.None;
    475533        else if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
     
    480538    private void jobsTreeView_DragDrop(object sender, DragEventArgs e) {
    481539      if (e.Effect != DragDropEffects.None) {
    482         var obj = (IItem)e.Data.GetData(Constants.DragDropDataFormat);
    483 
    484         IItem newObj = null;
    485         if (e.Effect.HasFlag(DragDropEffects.Copy)) {
    486           newObj = (IItem)obj.Clone();
    487         } else {
    488           newObj = obj;
    489         }
    490 
    491         //IOptimizer and IExecutables need some special care
    492         if (newObj is IOptimizer) {
    493           ((IOptimizer)newObj).Runs.Clear();
    494         }
    495         if (newObj is IExecutable) {
    496           IExecutable exec = (IExecutable)newObj;
    497           if (exec.ExecutionState != ExecutionState.Prepared) {
    498             exec.Prepare();
     540        var obj = e.Data.GetData(Constants.DragDropDataFormat);
     541
     542        var optimizer = obj as IOptimizer;
     543        if (optimizer != null) {
     544          IOptimizer newOptimizer = null;
     545          if (e.Effect.HasFlag(DragDropEffects.Copy)) {
     546            newOptimizer = (IOptimizer)optimizer.Clone();
     547            newOptimizer.Runs.Clear();
     548          } else {
     549            newOptimizer = optimizer;
    499550          }
    500         }
    501 
    502         ItemTask hiveTask = ItemTask.GetItemTaskForItem(newObj);
    503         Content.HiveTasks.Add(hiveTask.CreateHiveTask());
     551          if (newOptimizer.ExecutionState != ExecutionState.Prepared) {
     552            newOptimizer.Prepare();
     553          }
     554
     555          Content.HiveTasks.Add(new OptimizerHiveTask(newOptimizer));
     556        }
    504557      }
    505558    }
Note: See TracChangeset for help on using the changeset viewer.