Free cookie consent management tool by TermsFeed Policy Generator

source: stable/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Plugin.cs.frame @ 17456

Last change on this file since 17456 was 17186, checked in by swagner, 5 years ago

#2875: Merged r17182:17185 from trunk to stable

File size: 3.3 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  public class HeuristicLabProblemsDataAnalysisSymbolicViewsPlugin : PluginBase {
51    // HeuristicLab is marked with zone identifier 'Internet' after download.
52    // This propagates to all extracted files and can be checked in the file properties.
53    // IE prevents execution of MathJax JavaScript inside of untrusted html
54    // Therefore we need to programmatically unblock the displayModelFrame.html file before extracting.
55    // see http://engram404.net/programmatically-unblocking-downloaded-files/
56
57    // for removing the Zone.Identifier alternative NTFS stream (effectively unblocking the file)
58    [DllImport("kernel32.dll", SetLastError = true)]
59    private static extern bool DeleteFile(string lpFileName);
60
61    public override void OnLoad() {
62      base.OnLoad();
63
64      // unblock mathjax.zip ()
65      DeleteFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "displayModelFrame.html:Zone.Identifier"));
66    }
67  }
68}
Note: See TracBrowser for help on using the repository browser.