Changeset 13338 for branches/RefactorPluginInfrastructure-2522/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
- Timestamp:
- 11/23/15 16:14:30 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RefactorPluginInfrastructure-2522/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r12012 r13338 556 556 ((IActionUserInterfaceItem)item.Tag).Execute(); 557 557 } catch (Exception ex) { 558 ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex);558 ShowError(ex.Message, ex); 559 559 } 560 560 } … … 600 600 } 601 601 #endregion 602 603 #region Error Handling 604 public void ShowError(string message, Exception exception) { 605 ShowErrorDialog(this, message, exception); 606 } 607 private void ShowErrorDialog(Control owner, string message, Exception exception) { 608 if (owner == null) throw new ArgumentNullException("owner"); 609 if (owner.InvokeRequired) { 610 owner.Invoke(new Action<Control, string, Exception>(ShowErrorDialog), owner, message, exception); 611 } else { 612 using (ErrorDialog dialog = new ErrorDialog(message, exception)) { 613 dialog.ShowDialog(owner); 614 } 615 } 616 } 617 #endregion 602 618 } 603 619 }
Note: See TracChangeset
for help on using the changeset viewer.