Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using HeuristicLab.MainForm.WindowsForms;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.MainForm.Test {
|
---|
8 | public class SaveToolStripButtonItem : HeuristicLab.MainForm.WindowsForms.ToolBarItem, ITestUserInterfaceItemProvider {
|
---|
9 | public override int Position {
|
---|
10 | get { return 30; }
|
---|
11 | }
|
---|
12 |
|
---|
13 | public override string Name {
|
---|
14 | get { return "Save"; }
|
---|
15 | }
|
---|
16 |
|
---|
17 | public override System.Drawing.Image Image {
|
---|
18 | get { return HeuristicLab.Common.Resources.Resources.SaveIcon; }
|
---|
19 | }
|
---|
20 |
|
---|
21 | public override void Execute() {
|
---|
22 | new SaveAction().Execute(MainFormManager.MainForm);
|
---|
23 | }
|
---|
24 |
|
---|
25 | protected override void OnActiveViewChanged(object sender, EventArgs e) {
|
---|
26 | IMainForm mainform = MainFormManager.MainForm;
|
---|
27 | if (mainform.ActiveView == null)
|
---|
28 | this.ToolStripItem.Enabled = false;
|
---|
29 | else
|
---|
30 | this.ToolStripItem.Enabled = !(mainform.ActiveView is FormView1);
|
---|
31 | }
|
---|
32 |
|
---|
33 | protected override void OnViewChanged(object sender, EventArgs e) {
|
---|
34 | this.ToolStripItem.Enabled = !this.ToolStripItem.Enabled;
|
---|
35 | }
|
---|
36 | }
|
---|
37 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.