Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/11/10 19:00:47 (15 years ago)
Author:
mkommend
Message:

implemented check for MS ChartControls (ticket #893)

Location:
trunk/sources/HeuristicLab.Optimizer/3.3
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/HeuristicLab.Optimizer-3.3.csproj

    r3759 r3776  
    8787    <None Include="HeuristicLabOptimizerPlugin.cs.frame" />
    8888    <Compile Include="FileManager.cs" />
     89    <Compile Include="ChartControlsWarning.cs">
     90      <SubType>Form</SubType>
     91    </Compile>
     92    <Compile Include="ChartControlsWarning.Designer.cs">
     93      <DependentUpon>ChartControlsWarning.cs</DependentUpon>
     94    </Compile>
    8995    <Compile Include="MenuItems\ClipboardMenuItem.cs" />
    9096    <Compile Include="MenuItems\AboutMenuItem.cs" />
  • trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerMainForm.cs

    r3768 r3776  
    3030using HeuristicLab.MainForm;
    3131using HeuristicLab.MainForm.WindowsForms;
     32using System.IO;
    3233
    3334namespace HeuristicLab.Optimizer {
     
    8687        StartPage startPage = new StartPage();
    8788        startPage.Show();
     89      }
     90    }
     91
     92    private static string CHARTCONTROLASSEMBLY = "12System.Windows.Forsms.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35";
     93    private bool CheckChartControls() {
     94      try {
     95        Assembly chartControlsAssembly = Assembly.Load(CHARTCONTROLASSEMBLY);
     96        if (chartControlsAssembly != null)
     97          return true;
     98      }
     99      catch (FileNotFoundException) {
     100      }
     101      catch (FileLoadException) {
     102      }
     103      catch (BadImageFormatException) {
     104      }
     105      return false;
     106    }
     107
     108    protected override void OnShown(EventArgs e) {
     109      base.OnShown(e);
     110      if (!CheckChartControls()) {
     111        ChartControlsWarning dlg = new ChartControlsWarning();
     112        dlg.ShowDialog(this);
    88113      }
    89114    }
Note: See TracChangeset for help on using the changeset viewer.