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.3 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 {
|
---|
14 | internal class SaveToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider {
|
---|
15 | public override string Name {
|
---|
16 | get { return "Save"; }
|
---|
17 | }
|
---|
18 | public override string ToolTipText {
|
---|
19 | get { return "Save File (Ctrl + S)"; }
|
---|
20 | }
|
---|
21 | public override int Position {
|
---|
22 | get { return 30; }
|
---|
23 | }
|
---|
24 | public override Image Image {
|
---|
25 | get { return Resources.SaveIcon; }
|
---|
26 | }
|
---|
27 |
|
---|
28 | public override void MainFormInitialized(object sender, EventArgs e) {
|
---|
29 | ToolStripItem.Enabled = false;
|
---|
30 | }
|
---|
31 | public override void ActiveViewChanged(object sender, EventArgs e) {
|
---|
32 | IItemView activeView = MainFormManager.MainForm.ActiveView as IItemView;
|
---|
33 | ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Item.GetType())));
|
---|
34 | }
|
---|
35 |
|
---|
36 | public override void Execute() {
|
---|
37 | FileManager.Save();
|
---|
38 | }
|
---|
39 | }
|
---|
40 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.