Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs @ 2560

Last change on this file since 2560 was 2546, checked in by swagner, 15 years ago

Continued work on Optimizer and on adapting all views to the new MainForm concept (#770)

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows.Forms;
6using System.Drawing;
7using HeuristicLab.MainForm;
8using HeuristicLab.MainForm.WindowsForms;
9using HeuristicLab.Common.Resources;
10
11namespace HeuristicLab.Optimizer.MenuItems {
12  internal class CloseMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {
13    public override string Name {
14      get { return "&Close"; }
15    }
16    public override IEnumerable<string> Structure {
17      get { return new string[] { "&File" }; }
18    }
19    public override int Position {
20      get { return 1600; }
21    }
22
23    public override void MainFormInitialized(object sender, EventArgs e) {
24      ToolStripItem.Enabled = false;
25    }
26    public override void ActiveViewChanged(object sender, EventArgs e) {
27      ToolStripItem.Enabled = MainFormManager.MainForm.Views.FirstOrDefault() != null;
28    }
29
30    public override void Execute() {
31      MainFormManager.MainForm.CloseView(MainFormManager.MainForm.ActiveView);
32    }
33  }
34}
Note: See TracBrowser for help on using the repository browser.