Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperiment.cs @ 12320

Last change on this file since 12320 was 12320, checked in by arapeanu, 9 years ago

#2288: Added sliders functionality, dialog box for setting the number of repetitions for each batch + modified node importance weighting

File size: 1.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Windows.Forms;
4using HeuristicLab.MainForm;
5using HeuristicLab.Optimization;
6using HeuristicLab.Optimizer;
7
8namespace HeuristicLab.VariableInteractionNetworks
9{
10    internal class CreateTargetVariationExperiment : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider
11    {
12        public override string Name
13        {
14            get { return "Create Target Variation &Experiment"; }
15        }
16        public override IEnumerable<string> Structure
17        {
18            get { return new string[] { "&Edit" }; }
19        }
20        public override int Position
21        {
22            get { return 2300; }
23        }
24        public override string ToolTipText
25        {
26            get { return "Create an experiment for varying the target variable"; }
27        }
28
29        protected override void OnToolStripItemSet(EventArgs e)
30        {
31            ToolStripItem.Enabled = false;
32        }
33        protected override void OnActiveViewChanged(object sender, EventArgs e)
34        {
35            IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
36            ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked;
37        }
38
39        public override void Execute()
40        {
41            IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView;
42            if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IOptimizer) && !activeView.Locked)
43            {
44                using (CreateTargetVariationExperimentDialog dialog = new CreateTargetVariationExperimentDialog((IAlgorithm)activeView.Content))
45                {
46                    if (dialog.ShowDialog() == DialogResult.OK) MainFormManager.MainForm.ShowContent(dialog.Experiment);
47                }
48            }
49        }
50    }
51}
Note: See TracBrowser for help on using the repository browser.