Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/07/09 02:44:23 (15 years ago)
Author:
swagner
Message:

Continued work on Optimizer and on adapting all views to the new MainForm concept (#770)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs

    r2520 r2546  
    55using System.Windows.Forms;
    66using System.Drawing;
     7using HeuristicLab.MainForm;
    78using HeuristicLab.MainForm.WindowsForms;
    89using HeuristicLab.Common.Resources;
     10using HeuristicLab.Core;
     11using HeuristicLab.Core.Views;
    912
    1013namespace HeuristicLab.Optimizer.MenuItems {
    11   public class SaveAsMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {
     14  internal class SaveAsMenuItem : HeuristicLab.MainForm.WindowsForms.MenuItemBase, IOptimizerUserInterfaceItemProvider {
    1215    public override string Name {
    1316      get { return "Save &As..."; }
    1417    }
    15 
    1618    public override IEnumerable<string> Structure {
    1719      get { return new string[] { "&File" }; }
    1820    }
    19 
    2021    public override int Position {
    2122      get { return 1400; }
    2223    }
    23 
    2424    public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {
    2525      get { return ToolStripItemDisplayStyle.ImageAndText; }
    2626    }
    27 
    2827    public override Keys ShortCutKeys {
    2928      get { return Keys.Control | Keys.Shift | Keys.S; }
    3029    }
    3130
     31    public override void MainFormInitialized(object sender, EventArgs e) {
     32      ToolStripItem.Enabled = false;
     33    }
     34    public override void ActiveViewChanged(object sender, EventArgs e) {
     35      IItemView activeView = MainFormManager.MainForm.ActiveView as IItemView;
     36      ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Item.GetType())));
     37    }
     38
    3239    public override void Execute() {
    33       Actions.SaveAsAction.Execute();
     40      FileManager.SaveAs();
    3441    }
    3542  }
Note: See TracChangeset for help on using the changeset viewer.