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.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceProviderView.cs

    r15446 r15477  
    4646
    4747        Task.Factory.StartNew(() => {
    48           var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
     48          var activeView = (IContentView)MainFormManager.MainForm.ActiveView;
     49          var content = activeView.Content;
    4950          // lock active view and show progress bar
    50           IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView;
     51          try {
     52            var progress = Progress.Show(content, "Loading problem instance.");
    5153
    52           try {
    53             var progress = mainForm.AddOperationProgressToContent(activeView.Content,
    54               "Loading problem instance.", 0);
     54            Content.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; };
    5555
    56             Content.ProgressChanged +=
    57               (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; };
    58 
    59             instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType,
    60               importTypeDialog.CSVFormat);
     56            instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat);
    6157          } catch (Exception ex) {
    6258            ErrorWhileParsing(ex);
    6359            return;
    6460          } finally {
    65             mainForm.RemoveOperationProgressFromContent(activeView.Content);
     61            Progress.Hide(content);
    6662          }
    6763
Note: See TracChangeset for help on using the changeset viewer.