Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/22/13 11:31:32 (11 years ago)
Author:
ascheibe
Message:

#1042

  • changed Hive views to use MainForm for progress handling
  • removed Cancel timeout
  • setter for ProgressState is now private
  • added Start methods to Progress
  • removed unused methods from RefreshableHiveJobView
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBExperimentUploadView.cs

    r9893 r9894  
    5454    Algorithm selectedAlgorithm = null;
    5555    Problem selectedProblem = null;
    56     private ProgressView progressView;
    57     private Progress progress;
    5856
    5957    public OKBExperimentUploadView() {
    6058      InitializeComponent();
    61       progress = new Progress();
    6259    }
    6360
     
    9390      RunCreationClient.Instance.Refreshing += new EventHandler(RunCreationClient_Refreshing);
    9491      RunCreationClient.Instance.Refreshed += new EventHandler(RunCreationClient_Refreshed);
    95       progressView = new ProgressView(this, progress);
    9692    }
    9793
     
    9995      RunCreationClient.Instance.Refreshing -= new EventHandler(RunCreationClient_Refreshing);
    10096      RunCreationClient.Instance.Refreshed -= new EventHandler(RunCreationClient_Refreshed);
    101       if (progressView != null) {
    102         progressView.Dispose();
    103         progressView = null;
    104       }
     97
    10598      base.DeregisterContentEvents();
    10699    }
     
    194187        Invoke(new EventHandler(RunCreationClient_Refreshing), sender, e);
    195188      } else {
    196         progress.Status = "Refreshing algorithms and problems...";
    197         progress.ProgressState = ProgressState.Started;
     189        var message = "Refreshing algorithms and problems...";
     190        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
    198191      }
    199192    }
     
    203196        Invoke(new EventHandler(RunCreationClient_Refreshed), sender, e);
    204197      } else {
    205         progress.Finish();
     198        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    206199        SetEnabledStateOfControls();
    207200      }
     
    211204      var task = System.Threading.Tasks.Task.Factory.StartNew(UploadAsync);
    212205      task.ContinueWith((t) => {
    213         progress.Finish();
     206        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    214207        PluginInfrastructure.ErrorHandling.ShowErrorDialog("An exception occured while uploading the runs to the OKB.", t.Exception);
    215208      }, TaskContinuationOptions.OnlyOnFaulted);
     
    217210
    218211    private void UploadAsync() {
    219       progress.Status = "Uploading runs to OKB...";
    220       progress.ProgressValue = 0;
    221       progress.ProgressState = ProgressState.Started;
     212      var message = "Uploading runs to OKB...";
     213      IProgress progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
    222214      double count = dataGridView.Rows.Count;
    223215      int i = 0;
     
    234226        progress.ProgressValue = ((double)i) / count;
    235227      }
    236       progress.Finish();
     228      MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
    237229      ClearRuns();
    238230    }
Note: See TracChangeset for help on using the changeset viewer.