Last change
on this file since 17399 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 | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 | using System.Windows.Forms;
|
---|
7 | using HeuristicLab.Common;
|
---|
8 | using HeuristicLab.MainForm;
|
---|
9 | using HeuristicLab.Optimizer;
|
---|
10 |
|
---|
11 | namespace 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.