Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/22/18 21:51:08 (6 years ago)
Author:
jkarder
Message:

#2845: adapted BioBoost addon

Location:
addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost.Views/3.3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost.Views/3.3/BioBoostCompoundSolutionEditor.cs

    r13074 r16447  
    583583    private void optimizeTransportsButton_Click(object sender, EventArgs e) {
    584584      using (BackgroundWorker bg = new BackgroundWorker()) {
    585         MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Optimizing Transports...");
     585        Progress.Show(this, "Optimizing Transports...", ProgressMode.Indeterminate);
    586586        bg.DoWork += (o, a) => OptimizeTransports();
    587         bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     587        bg.RunWorkerCompleted += (o, a) => Progress.Hide(this);
    588588        bg.RunWorkerAsync();
    589589      }
     
    592592    private void optimizeUtilizationsButton_Click(object sender, EventArgs e) {
    593593      using (BackgroundWorker bg = new BackgroundWorker()) {
    594         MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Optimizing Utilizations...");
     594        Progress.Show(this, "Optimizing Utilizations...", ProgressMode.Indeterminate);
    595595        bg.DoWork += (o, a) => OptimizeUtilizations();
    596         bg.RunWorkerCompleted += (o, a) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this);
     596        bg.RunWorkerCompleted += (o, a) => Progress.Hide(this);
    597597        bg.RunWorkerAsync();
    598598      }
  • addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost.Views/3.3/MenuItems/CreateBioBoostExperimentMenuItem.cs

    r13074 r16447  
    7979    public override void Execute() {
    8080      IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView;
    81       var mainForm = ((MainForm.WindowsForms.MainForm) MainFormManager.MainForm);
    82       var progress = mainForm.AddOperationProgressToContent(activeView.Content, "Generating Algorithm Configurations");
     81      var progress = Progress.Show(activeView.Content, "Generating Algorithm Configurations");
    8382      int n = nValues(typeof (Pathway))*nValues(typeof (Region))*nValues(typeof (Price))* nValues(typeof (Implementation));
    8483      int count = 0;
    85       progress.Start();
    8684      progress.ProgressValue = 1.0*count/n;
    8785      var alg = activeView.Content as IAlgorithm;
     
    119117          dialog.ShowDialog();
    120118        }
    121         mainForm.RemoveOperationProgressFromContent(activeView.Content);
     119        Progress.Hide(activeView.Content);
    122120      }, null);
    123121
  • addons/HeuristicLab.Problems.BioBoost/HeuristicLab.Problems.BioBoost.Views/3.3/MenuItems/ExportSolutionMenuItem.cs

    r13074 r16447  
    8686        var folderName = folderBrowserDialog.SelectedPath;
    8787        IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView;
    88         var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
    89         mainForm.AddOperationProgressToContent(activeView.Content, "Export solutions.");
     88        Progress.Show(activeView.Content, "Export solutions.", ProgressMode.Indeterminate);
    9089
    9190        Action<IContentView> action = (view) => {
     
    119118            dialog.ShowDialog();
    120119          }
    121           mainForm.RemoveOperationProgressFromContent(activeView.Content);
     120          Progress.Hide(activeView.Content);
    122121        }, null);
    123122      }
Note: See TracChangeset for help on using the changeset viewer.