Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/16/17 10:30:21 (7 years ago)
Author:
pfleck
Message:

#2845

  • Added an explicit method for StartMarquee.
  • Renamed Add/RemoveOperationProgress methods.
  • Moved progress helpers from MainForm into static Progress methods named Show and Hide.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/EnhancedProgress/HeuristicLab.Clients.OKB.Views/3.3/RunCreation/Views/OKBExperimentUploadView.cs

    r15446 r15477  
    188188      if (InvokeRequired) { Invoke((Action<object, EventArgs>)RunCreationClient_Refreshing, sender, e); return; }
    189189      var message = "Refreshing algorithms and problems...";
    190       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message);
     190      Progress.ShowMarquee(this, message);
    191191      refreshing = true;
    192192      SetEnabledStateOfControls();
     
    195195    private void RunCreationClient_Refreshed(object sender, EventArgs e) {
    196196      if (InvokeRequired) { Invoke((Action<object, EventArgs>)RunCreationClient_Refreshed, sender, e); return; }
    197       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     197      Progress.Hide(this);
    198198      refreshing = false;
    199199      SetEnabledStateOfControls();
     
    203203      var task = System.Threading.Tasks.Task.Factory.StartNew(UploadAsync);
    204204      task.ContinueWith((t) => {
    205         MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     205        Progress.Hide(this);
    206206        PluginInfrastructure.ErrorHandling.ShowErrorDialog("An exception occured while uploading the runs to the OKB.", t.Exception);
    207207      }, TaskContinuationOptions.OnlyOnFaulted);
     
    210210    private void UploadAsync() {
    211211      var message = "Uploading runs to OKB...";
    212       IProgress progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, message, 0);
     212      IProgress progress = Progress.Show(this, message);
    213213      double count = dataGridView.Rows.Count;
    214214      int i = 0;
     
    226226        progress.ProgressValue = ((double)i) / count;
    227227      }
    228       MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     228      Progress.Hide(this);
    229229      ClearRuns();
    230230    }
Note: See TracChangeset for help on using the changeset viewer.