Changeset 3483 for trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Timestamp:
- 04/22/10 05:14:39 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CopyToClipboardMenuItem.cs
r3416 r3483 39 39 get { return 2100; } 40 40 } 41 public override Keys ShortCutKeys {42 get { return Keys.Control | Keys.C; }43 }44 41 45 42 protected override void OnToolStripItemSet(EventArgs e) { … … 48 45 protected override void OnActiveViewChanged(object sender, EventArgs e) { 49 46 ItemView activeView = MainFormManager.MainForm.ActiveView as ItemView; 50 ToolStripItem.Enabled = (activeView != null) && ( !activeView.Locked);47 ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && !activeView.Locked; 51 48 } 52 49 53 50 public override void Execute() { 54 51 ItemView activeView = MainFormManager.MainForm.ActiveView as ItemView; 55 if ((activeView != null) && ( !activeView.Locked)) {52 if ((activeView != null) && (activeView.Content != null) && !activeView.Locked) { 56 53 Clipboard<IItem> clipboard = ((OptimizerMainForm)MainFormManager.MainForm).Clipboard; 57 54 clipboard.AddItem((IItem)activeView.Content.Clone()); -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs
r3416 r3483 25 25 using System.Linq; 26 26 using System.Windows.Forms; 27 using HeuristicLab.Common; 27 28 using HeuristicLab.MainForm; 28 29 … … 47 48 protected override void OnActiveViewChanged(object sender, EventArgs e) { 48 49 var views = from v in MainFormManager.MainForm.Views.OfType<IContentView>() 50 where v.Content != null 51 where v.Content is IStorableContent 49 52 where !v.Locked 50 53 select v; -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs
r3416 r3483 23 23 using System.Collections.Generic; 24 24 using System.Windows.Forms; 25 using HeuristicLab.Common; 25 26 using HeuristicLab.MainForm; 26 27 … … 45 46 protected override void OnActiveViewChanged(object sender, EventArgs e) { 46 47 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 47 ToolStripItem.Enabled = (activeView != null) && (!activeView.Locked); 48 ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && 49 (activeView.Content is IStorableContent) && !activeView.Locked; 48 50 } 49 51 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs
r3416 r3483 24 24 using System.Drawing; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Common; 26 27 using HeuristicLab.MainForm; 27 28 … … 49 50 protected override void OnActiveViewChanged(object sender, EventArgs e) { 50 51 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 51 ToolStripItem.Enabled = (activeView != null) && (!activeView.Locked); 52 ToolStripItem.Enabled = (activeView != null) && (activeView.Content != null) && 53 (activeView.Content is IStorableContent) && !activeView.Locked; 52 54 } 53 55
Note: See TracChangeset
for help on using the changeset viewer.