Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/23/15 16:14:30 (8 years ago)
Author:
gkronber
Message:

#2522:

  • moved UI components out of HeuristicLab.PluginInfrastructure -> HeuristicLab.PluginInfrastructure.UI
  • moved ErrorDialog to HeuristicLab.MainForm.WindowsForms
  • moved ErrorHandling (for building an error message string) to HeuristicLab.Common
  • Changed exception handlers in Views to use MainForm.ShowError()
  • Changed usages for ErrorDialog in non-UI components to throw exceptions instead.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/RefactorPluginInfrastructure-2522/HeuristicLab.Optimizer/3.3/FileManager.cs

    r12012 r13338  
    4646        IView view = MainFormManager.MainForm.ShowContent(newItemDialog.Item);
    4747        if (view == null)
    48           ErrorHandling.ShowErrorDialog("There is no view for the new item. It cannot be displayed.", new InvalidOperationException("No View Available"));
     48          MainFormManager.MainForm.ShowError("There is no view for the new item. It cannot be displayed.", new InvalidOperationException("No View Available"));
    4949      }
    5050    }
     
    7777        IView view = MainFormManager.MainForm.ShowContent(content);
    7878        if (view == null)
    79           ErrorHandling.ShowErrorDialog("There is no view for the loaded item. It cannot be displayed.", new InvalidOperationException("No View Available"));
     79          MainFormManager.MainForm.ShowError("There is no view for the loaded item. It cannot be displayed.", new InvalidOperationException("No View Available"));
    8080      }
    8181      catch (Exception ex) {
    82         ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, "Cannot open file.", ex);
     82        MainFormManager.MainForm.ShowError("Cannot open file.", ex);
    8383      }
    8484      finally {
    85         ((MainForm.WindowsForms.MainForm)MainFormManager.MainForm).ResetAppStartingCursor();
     85        MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().ResetAppStartingCursor();
    8686      }
    8787    }
     
    9999          SaveAs(view);
    100100        else {
    101           MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().SetAppStartingCursor();
     101          MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().SetAppStartingCursor();
    102102          SetSaveOperationProgressInContentViews(content, true);
    103103          ContentManager.SaveAsync(content, content.Filename, true, SavingCompleted);
     
    147147      }
    148148      catch (Exception ex) {
    149         ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, "Cannot save file.", ex);
     149        MainFormManager.MainForm.ShowError("Cannot save file.", ex);
    150150      }
    151151      finally {
Note: See TracChangeset for help on using the changeset viewer.