Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/SaveToolStripButtonItem.cs @ 2795

Last change on this file since 2795 was 2696, checked in by mkommend, 15 years ago

first version of redesigned MainForm (ticket #857)

File size: 1.1 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using HeuristicLab.MainForm.WindowsForms;
6
7namespace 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.