Changeset 5984
- Timestamp:
- 04/08/11 11:40:48 (13 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure/3.3
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/ErrorHandling/ErrorHandling.cs
r5445 r5984 25 25 namespace HeuristicLab.PluginInfrastructure { 26 26 public static class ErrorHandling { 27 public static readonly string NewLine = Environment.NewLine;28 29 27 public static string BuildErrorMessage(Exception exception) { 30 28 if (exception == null) { 31 29 return string.Empty; 32 30 } else { 33 string message = exception.GetType().Name + ": " + exception.Message + NewLine +31 string message = exception.GetType().Name + ": " + exception.Message + Environment.NewLine + 34 32 exception.StackTrace; 35 33 36 34 while (exception.InnerException != null) { 37 35 exception = exception.InnerException; 38 message += NewLine +39 "-----" + NewLine +40 exception.GetType().Name + ": " + exception.Message + NewLine +36 message += Environment.NewLine + 37 "-----" + Environment.NewLine + 38 exception.GetType().Name + ": " + exception.Message + Environment.NewLine + 41 39 exception.StackTrace; 42 40 } … … 53 51 public static void ShowErrorDialog(string message, Exception exception) { 54 52 using (ErrorDialog dialog = new ErrorDialog(message, exception)) { 53 dialog.StartPosition = FormStartPosition.CenterScreen; 55 54 dialog.ShowDialog(); 56 55 } -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj
r5741 r5984 221 221 <Compile Include="BaseClasses\PluginBase.cs" /> 222 222 <Compile Include="DefaultApplicationManager.cs" /> 223 <Compile Include="ErrorHandling\FrameworkVersionWarning.cs"> 224 <SubType>Form</SubType> 225 </Compile> 226 <Compile Include="ErrorHandling\FrameworkVersionWarning.Designer.cs"> 227 <DependentUpon>FrameworkVersionWarning.cs</DependentUpon> 228 </Compile> 223 229 <Compile Include="ErrorHandling\ErrorDialog.cs"> 224 230 <SubType>Form</SubType> -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Main.cs
r5445 r5984 34 34 /// <param name="args">Command line arguments</param> 35 35 public static void Run(string[] args) { 36 try { 36 bool fullProfileInstalled = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full") != null; 37 if (!fullProfileInstalled) { 37 38 Application.EnableVisualStyles(); 38 39 Application.SetCompatibleTextRenderingDefault(false); 39 Application.Run(new StarterForm()); 40 } 41 catch (Exception ex) { 42 ErrorHandling.ShowErrorDialog(ex); 40 Application.Run(new FrameworkVersionWarning()); 41 } else { 42 try { 43 Application.EnableVisualStyles(); 44 Application.SetCompatibleTextRenderingDefault(false); 45 Application.Run(new StarterForm()); 46 } 47 catch (Exception ex) { 48 ErrorHandling.ShowErrorDialog(ex); 49 } 43 50 } 44 51 }
Note: See TracChangeset
for help on using the changeset viewer.