Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/04/19 14:45:47 (5 years ago)
Author:
mkommend
Message:

#2845: Merged 16430 into stable.

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.DataPreprocessing.Views

  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r15584 r17062  
    165165        await Task.Run(() => {
    166166          TProblemData instance;
    167           var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
    168167          // lock active view and show progress bar
    169           var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
    170168
    171169          try {
    172             var progress = mainForm.AddOperationProgressToContent(activeView.Content, "Loading problem instance.");
    173 
     170            var progress = Progress.Show(Content, "Loading problem instance.");
    174171            instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; };
    175172
     
    177174          } catch (IOException ex) {
    178175            MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
    179             mainForm.RemoveOperationProgressFromContent(activeView.Content);
     176            Progress.Hide(Content);
    180177            return;
    181178          }
     
    185182            MessageBox.Show(string.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance");
    186183          } finally {
    187             mainForm.RemoveOperationProgressFromContent(activeView.Content);
     184            Progress.Hide(Content);
    188185          }
    189186        });
     
    222219          var storable = itemCreator() as IStorableContent;
    223220          if (storable != null) {
    224             var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
    225             var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
    226221            try {
    227               mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");
     222              Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate);
    228223              ContentManager.Save(storable, saveFileDialog.FileName, compressed);
    229224            } finally {
    230               mainForm.RemoveOperationProgressFromContent(activeView.Content);
     225              Progress.Hide(Content);
    231226            }
    232227          }
     
    244239      if (saveFileDialog.ShowDialog() == DialogResult.OK) {
    245240        Task.Run(() => {
    246           var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
    247           var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
    248241          try {
    249242            var problemData = Content.CreateNewProblemData();
    250             mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");
     243            Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate);
    251244            if (problemData is TimeSeriesPrognosisProblemData)
    252245              Export(new TimeSeriesPrognosisCSVInstanceProvider(), problemData, saveFileDialog.FileName);
     
    256249              Export(new ClassificationCSVInstanceProvider(), problemData, saveFileDialog.FileName);
    257250          } finally {
    258             mainForm.RemoveOperationProgressFromContent(activeView.Content);
     251            Progress.Hide(Content);
    259252          }
    260253        });
Note: See TracChangeset for help on using the changeset viewer.