Rev | Line | |
---|
[2520] | 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;
|
---|
[2555] | 10 | using HeuristicLab.Core;
|
---|
| 11 | using HeuristicLab.Core.Views;
|
---|
[2520] | 12 |
|
---|
| 13 | namespace HeuristicLab.Optimizer {
|
---|
[2546] | 14 | internal class SaveAllToolBarItem : HeuristicLab.MainForm.WindowsForms.ToolBarItemBase, IOptimizerUserInterfaceItemProvider {
|
---|
[2520] | 15 | public override string Name {
|
---|
| 16 | get { return "Save All"; }
|
---|
| 17 | }
|
---|
| 18 | public override string ToolTipText {
|
---|
| 19 | get { return "Save All Files"; }
|
---|
| 20 | }
|
---|
| 21 | public override int Position {
|
---|
| 22 | get { return 40; }
|
---|
| 23 | }
|
---|
| 24 | public override Image Image {
|
---|
| 25 | get { return Resources.SaveAllIcon; }
|
---|
| 26 | }
|
---|
| 27 |
|
---|
[2546] | 28 | public override void MainFormInitialized(object sender, EventArgs e) {
|
---|
| 29 | ToolStripItem.Enabled = false;
|
---|
| 30 | }
|
---|
| 31 | public override void ActiveViewChanged(object sender, EventArgs e) {
|
---|
[2555] | 32 | var views = from v in MainFormManager.MainForm.Views
|
---|
| 33 | where v is IItemView
|
---|
| 34 | where CreatableAttribute.IsCreatable(((IItemView)v).Item.GetType())
|
---|
| 35 | select v;
|
---|
| 36 | ToolStripItem.Enabled = views.FirstOrDefault() != null;
|
---|
[2546] | 37 | }
|
---|
| 38 |
|
---|
[2520] | 39 | public override void Execute() {
|
---|
[2546] | 40 | FileManager.SaveAll();
|
---|
[2520] | 41 | }
|
---|
| 42 | }
|
---|
| 43 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.