Changeset 3571 for trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Timestamp:
- 04/30/10 13:07:31 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseAllMenuItem.cs
r3498 r3571 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.MainForm; 27 using HeuristicLab.MainForm.WindowsForms; 27 28 28 29 namespace HeuristicLab.Optimizer.MenuItems { … … 42 43 } 43 44 protected override void OnActiveViewChanged(object sender, EventArgs e) { 44 ToolStripItem.Enabled = MainFormManager.MainForm.Views.Any<IView>(v => v.IsShown );45 ToolStripItem.Enabled = MainFormManager.MainForm.Views.Any<IView>(v => v.IsShown && !(v is Sidebar)); 45 46 } 46 47 47 48 public override void Execute() { 48 MainFormManager.MainForm.CloseAllViews(); 49 foreach (IView view in MainFormManager.MainForm.Views) 50 if (!(view is Sidebar)) 51 view.Close(); 49 52 } 50 53 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs
r3498 r3571 24 24 using System.Windows.Forms; 25 25 using HeuristicLab.MainForm; 26 using HeuristicLab.MainForm.WindowsForms; 26 27 27 28 namespace HeuristicLab.Optimizer.MenuItems { … … 41 42 } 42 43 protected override void OnActiveViewChanged(object sender, EventArgs e) { 43 ToolStripItem.Enabled = MainFormManager.MainForm.ActiveView != null; 44 IView view = MainFormManager.MainForm.ActiveView; 45 ToolStripItem.Enabled = !(view is Sidebar); 44 46 } 45 47 46 48 public override void Execute() { 47 MainFormManager.MainForm.ActiveView.Close(); 49 IView view = MainFormManager.MainForm.ActiveView; 50 if (!(view is Sidebar)) 51 view.Close(); 48 52 } 49 53 }
Note: See TracChangeset
for help on using the changeset viewer.