- Timestamp:
- 11/23/15 16:14:30 (9 years ago)
- Location:
- branches/RefactorPluginInfrastructure-2522/HeuristicLab.Common/3.3
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/RefactorPluginInfrastructure-2522/HeuristicLab.Common/3.3/ErrorHandling.cs
r13337 r13338 21 21 22 22 using System; 23 using System.Windows.Forms;23 using HeuristicLab.PluginInfrastructure; 24 24 25 namespace HeuristicLab. PluginInfrastructure{25 namespace HeuristicLab.Common { 26 26 public static class ErrorHandling { 27 27 public static string BuildErrorMessage(Exception exception) { … … 29 29 return string.Empty; 30 30 } else { 31 var asm = typeof(ErrorHandling).Assembly; 31 32 string message = 32 "HeuristicLab version: " + AssemblyHelpers.GetFileVersion(typeof(ErrorHandling).Assembly) + Environment.NewLine +33 "HeuristicLab version: " + asm.GetFileVersion() + Environment.NewLine + 33 34 exception.GetType().Name + ": " + exception.Message + Environment.NewLine + 34 35 exception.StackTrace; … … 44 45 } 45 46 } 46 47 public static void ShowErrorDialog(Exception exception) {48 ShowErrorDialog(string.Empty, exception);49 }50 public static void ShowErrorDialog(Control owner, Exception exception) {51 ShowErrorDialog(owner, string.Empty, exception);52 }53 public static void ShowErrorDialog(string message, Exception exception) {54 using (ErrorDialog dialog = new ErrorDialog(message, exception)) {55 dialog.StartPosition = FormStartPosition.CenterScreen;56 dialog.ShowDialog();57 }58 }59 public static void ShowErrorDialog(Control owner, string message, Exception exception) {60 if (owner == null) throw new ArgumentNullException("owner");61 if (owner.InvokeRequired) {62 owner.Invoke(new Action<Control, string, Exception>(ShowErrorDialog), owner, message, exception);63 } else {64 using (ErrorDialog dialog = new ErrorDialog(message, exception)) {65 dialog.ShowDialog(owner);66 }67 }68 }69 47 } 70 48 } -
branches/RefactorPluginInfrastructure-2522/HeuristicLab.Common/3.3/HeuristicLab.Common-3.3.csproj
r12292 r13338 131 131 <Compile Include="Constants.cs" /> 132 132 <Compile Include="ArrayExtensions.cs" /> 133 <Compile Include="ErrorHandling.cs" /> 133 134 <Compile Include="ListExtensions.cs" /> 134 135 <Compile Include="Point2D.cs" />
Note: See TracChangeset
for help on using the changeset viewer.