Free cookie consent management tool by TermsFeed Policy Generator

source: branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame @ 17434

Last change on this file since 17434 was 17434, checked in by bburlacu, 5 years ago

#1772: Merge trunk changes and fix all errors and compilation warnings.

File size: 3.4 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Text;
25using HeuristicLab.PluginInfrastructure;
26using System.Runtime.InteropServices;
27using System.IO;
28
29namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views {
30  [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic.Views","Provides views for symbolic data analysis problem classes.", "3.4.12.$WCREV$")]
31  [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.dll", PluginFileType.Assembly)]
32  [PluginFile("displayModelFrame.html", PluginFileType.Data)]
33  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
34  [PluginDependency("HeuristicLab.Collections", "3.3")]
35  [PluginDependency("HeuristicLab.Common", "3.3")]
36  [PluginDependency("HeuristicLab.Common.Resources", "3.3")]
37  [PluginDependency("HeuristicLab.Core", "3.3")]
38  [PluginDependency("HeuristicLab.Core.Views", "3.3")]
39  [PluginDependency("HeuristicLab.Data", "3.3")]
40  [PluginDependency("HeuristicLab.Data.Views", "3.3")]
41  [PluginDependency("HeuristicLab.EPPlus", "4.0.3")]
42  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding", "3.4")]
43  [PluginDependency("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views", "3.4")]
44  [PluginDependency("HeuristicLab.MainForm", "3.3")]
45  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
46  [PluginDependency("HeuristicLab.MathJax", "1.2")]
47  [PluginDependency("HeuristicLab.Optimization","3.3")]
48  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
49  [PluginDependency("HeuristicLab.Problems.DataAnalysis.Symbolic", "3.4")]
50  [PluginDependency("HeuristicLab.EvolutionTracking", "3.4")]
51  [PluginDependency("HeuristicLab.EvolutionTracking.Views", "3.4")]
52  public class HeuristicLabProblemsDataAnalysisSymbolicViewsPlugin : PluginBase {
53    // HeuristicLab is marked with zone identifier 'Internet' after download.
54    // This propagates to all extracted files and can be checked in the file properties.
55    // IE prevents execution of MathJax JavaScript inside of untrusted html
56    // Therefore we need to programmatically unblock the displayModelFrame.html file before extracting.
57    // see http://engram404.net/programmatically-unblocking-downloaded-files/
58
59    // for removing the Zone.Identifier alternative NTFS stream (effectively unblocking the file)
60    [DllImport("kernel32.dll", SetLastError = true)]
61    private static extern bool DeleteFile(string lpFileName);
62
63    public override void OnLoad() {
64      base.OnLoad();
65
66      // unblock mathjax.zip ()
67      DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "displayModelFrame.html:Zone.Identifier"));
68    }
69  }
70}
Note: See TracBrowser for help on using the repository browser.