Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/MenuItems/ExportJsonTemplateMenuItem.cs @ 17843

Last change on this file since 17843 was 17331, checked in by dpiringe, 5 years ago

#3026

  • added new project: HeuristicLab.JsonInterface.OptimizerIntegration -> to generate/load .json templates in HeuristicLab.Optimizer
  • added new menu dropdown items (Import/Export) in HeuristicLab.Optimizer -> they are only active when they have items
  • added item for Import/Export menu items (Json-Template), logic in file FileManager.cs in project HeuristicLab.JsonInterface.OptimizerIntegration
  • repositioned CloseMenuItem, CloseAllMenuItem and added new seperator in menu File (to separate import/export from save/open and close/closeAll)
File size: 1.3 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using System.Windows.Forms;
7using HeuristicLab.Common;
8using HeuristicLab.MainForm;
9using HeuristicLab.Optimizer;
10
11namespace HeuristicLab.JsonInterface.OptimizerIntegration {
12  internal class ExportJsonTemplateMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
13    public override string Name {
14      get { return "Json-Template..."; }
15    }
16    public override IEnumerable<string> Structure {
17      get { return new string[] { "&File", "&Export" }; }
18    }
19    public override int Position {
20      get { return 1601; }
21    }
22
23    protected override void OnToolStripItemSet(EventArgs e) {
24      ToolStripItem.Enabled = false;
25    }
26    protected override void OnActiveViewChanged(object sender, EventArgs e) {
27      IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
28      ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) &&
29                              (activeView.Content is IStorableContent) && !activeView.Locked && activeView.Enabled;
30    }
31
32    public override void Execute() {
33      FileManager.ExportJsonTemplate();
34    }
35  }
36}
Note: See TracBrowser for help on using the repository browser.