Last change
on this file since 2713 was
2713,
checked in by swagner, 15 years ago
|
Adapted HL 3.3 plugins according to changes in MainForm (#857)
|
File size:
1.4 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows.Forms;
|
---|
6 | using System.Drawing;
|
---|
7 | using HeuristicLab.MainForm;
|
---|
8 | using HeuristicLab.MainForm.WindowsForms;
|
---|
9 | using HeuristicLab.Common.Resources;
|
---|
10 | using HeuristicLab.Core;
|
---|
11 | using HeuristicLab.Core.Views;
|
---|
12 |
|
---|
13 | namespace HeuristicLab.Optimizer.MenuItems {
|
---|
14 | internal class SaveAllMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItem, IOptimizerUserInterfaceItemProvider {
|
---|
15 | public override string Name {
|
---|
16 | get { return "Save Al&l"; }
|
---|
17 | }
|
---|
18 | public override IEnumerable<string> Structure {
|
---|
19 | get { return new string[] { "&File" }; }
|
---|
20 | }
|
---|
21 | public override int Position {
|
---|
22 | get { return 1500; }
|
---|
23 | }
|
---|
24 | public override Image Image {
|
---|
25 | get { return Resources.SaveAllIcon; }
|
---|
26 | }
|
---|
27 |
|
---|
28 | protected override void OnToolStripItemSet(EventArgs e) {
|
---|
29 | ToolStripItem.Enabled = false;
|
---|
30 | }
|
---|
31 | protected override void OnActiveViewChanged(object sender, EventArgs e) {
|
---|
32 | var views = from v in MainFormManager.MainForm.Views
|
---|
33 | where v is IContentView
|
---|
34 | where CreatableAttribute.IsCreatable(((IContentView)v).Content.GetType())
|
---|
35 | select v;
|
---|
36 | ToolStripItem.Enabled = views.FirstOrDefault() != null;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public override void Execute() {
|
---|
40 | FileManager.SaveAll();
|
---|
41 | }
|
---|
42 | }
|
---|
43 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.