Changeset 13352
- Timestamp:
- 11/24/15 11:53:58 (9 years ago)
- Location:
- branches/RefactorPluginInfrastructure-2522
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/RefactorPluginInfrastructure-2522/HeuristicLab.MainForm.WindowsForms/3.3/Dialogs/ErrorDialog.cs
r13338 r13352 26 26 namespace HeuristicLab.MainForm.WindowsForms { 27 27 public partial class ErrorDialog : Form { 28 public ErrorDialog() { 28 public ErrorDialog() : this(null, null) { } 29 public ErrorDialog(Exception exception) : this(null, exception) { } 30 public ErrorDialog(string message) : this(message, null) { } 31 public ErrorDialog(string message, Exception exception) { 29 32 InitializeComponent(); 30 Initialize(null, null);31 }32 public ErrorDialog(Exception exception)33 : this() {34 Initialize(null, exception);35 }36 public ErrorDialog(string message, Exception exception)37 : this() {38 33 Initialize(message, exception); 39 34 } … … 59 54 System.Diagnostics.Process.Start("mailto:" + supportLinkLabel.Text); 60 55 supportLinkLabel.LinkVisited = true; 61 } 62 catch (Exception) { } 56 } catch (Exception) { } 63 57 } 64 58 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r13338 r13352 602 602 603 603 #region Error Handling 604 public void ShowError(string message) { 605 ShowErrorDialog(this, message); 606 } 607 public void ShowError(Exception ex) { 608 ShowErrorDialog(this, ex); 609 } 604 610 public void ShowError(string message, Exception exception) { 605 611 ShowErrorDialog(this, message, exception); 612 } 613 private void ShowErrorDialog(Control owner, string message) { 614 if (owner == null) throw new ArgumentNullException("owner"); 615 if (owner.InvokeRequired) { 616 owner.Invoke(new Action<Control, string, Exception>(ShowErrorDialog), owner, message); 617 } else { 618 using (ErrorDialog dialog = new ErrorDialog(message)) { 619 dialog.ShowDialog(owner); 620 } 621 } 622 } 623 private void ShowErrorDialog(Control owner, Exception ex) { 624 if (owner == null) throw new ArgumentNullException("owner"); 625 if (owner.InvokeRequired) { 626 owner.Invoke(new Action<Control, string, Exception>(ShowErrorDialog), owner, ex); 627 } else { 628 using (ErrorDialog dialog = new ErrorDialog(ex)) { 629 dialog.ShowDialog(owner); 630 } 631 } 606 632 } 607 633 private void ShowErrorDialog(Control owner, string message, Exception exception) { -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.MainForm/3.3/Interfaces/IMainForm.cs
r13338 r13352 42 42 IContentView ShowContent(IContent content, Type viewType); 43 43 void ShowError(string message, Exception e); 44 void ShowError(string message); 45 void ShowError(Exception e); 44 46 45 47 Type UserInterfaceItemType { get; }
Note: See TracChangeset
for help on using the changeset viewer.