Changeset 15171 for branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3/MenuItems
- Timestamp:
- 07/08/17 12:31:54 (7 years ago)
- Location:
- branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3
-
Property
svn:ignore
set to
Plugin.cs
-
Property
svn:ignore
set to
-
branches/ParameterConfigurationEncoding/HeuristicLab.Encodings.ParameterConfigurationEncoding.Views/3.3/MenuItems/CreateExperimentMenuItemV2.cs
r8535 r15171 23 23 using System.Collections.Generic; 24 24 using System.Windows.Forms; 25 using HeuristicLab.Core;26 25 using HeuristicLab.MainForm; 27 26 using HeuristicLab.Optimization; 28 27 using HeuristicLab.Optimizer; 29 using HeuristicLab.PluginInfrastructure;30 28 31 29 namespace HeuristicLab.Encodings.ParameterConfigurationEncoding.Views { 32 30 public class CreateExperimentMenuItemV2 : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider { 33 31 public override string Name { 34 get { return "Create E xperiment (v2)"; }32 get { return "Create E&xperiment (v2)"; } 35 33 } 36 34 public override IEnumerable<string> Structure { … … 49 47 protected override void OnActiveViewChanged(object sender, EventArgs e) { 50 48 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 51 ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && (activeView.Content is IAlgorithm) && !activeView.Locked;49 ToolStripItem.Enabled = (activeView != null) && (activeView.Content as IAlgorithm != null) && !activeView.Locked; 52 50 } 53 51 54 52 public override void Execute() { 55 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 56 if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IAlgorithm) && !activeView.Locked) { 57 using (CreateExperimentDialogV2 dialog = new CreateExperimentDialogV2((IAlgorithm)activeView.Content, ApplicationManager.Manager.GetInstances<IEngine>())) { 58 if (dialog.ShowDialog() == DialogResult.OK) MainFormManager.MainForm.ShowContent(dialog.Experiment); 59 } 53 var activeView = MainFormManager.MainForm.ActiveView as IContentView; 54 if (activeView == null) return; 55 var algorithm = activeView.Content as IAlgorithm; 56 if (algorithm == null) return; 57 58 if (!activeView.Locked) { 59 MainFormManager.MainForm.ShowContent(algorithm, typeof(CreateExperimentView)); 60 60 } 61 61 }
Note: See TracChangeset
for help on using the changeset viewer.