Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/08/11 11:40:48 (13 years ago)
Author:
gkronber
Message:

#1466 implemented check for .NET version 4.0 (full profile) and a warning dialog with the download URL.

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  
    2525namespace HeuristicLab.PluginInfrastructure {
    2626  public static class ErrorHandling {
    27     public static readonly string NewLine = Environment.NewLine;
    28 
    2927    public static string BuildErrorMessage(Exception exception) {
    3028      if (exception == null) {
    3129        return string.Empty;
    3230      } else {
    33         string message = exception.GetType().Name + ": " + exception.Message + NewLine +
     31        string message = exception.GetType().Name + ": " + exception.Message + Environment.NewLine +
    3432                         exception.StackTrace;
    3533
    3634        while (exception.InnerException != null) {
    3735          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 +
    4139                     exception.StackTrace;
    4240        }
     
    5351    public static void ShowErrorDialog(string message, Exception exception) {
    5452      using (ErrorDialog dialog = new ErrorDialog(message, exception)) {
     53        dialog.StartPosition = FormStartPosition.CenterScreen;
    5554        dialog.ShowDialog();
    5655      }
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/HeuristicLab.PluginInfrastructure-3.3.csproj

    r5741 r5984  
    221221    <Compile Include="BaseClasses\PluginBase.cs" />
    222222    <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>
    223229    <Compile Include="ErrorHandling\ErrorDialog.cs">
    224230      <SubType>Form</SubType>
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Main.cs

    r5445 r5984  
    3434    /// <param name="args">Command line arguments</param>
    3535    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) {
    3738        Application.EnableVisualStyles();
    3839        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        }
    4350      }
    4451    }
Note: See TracChangeset for help on using the changeset viewer.