Changeset 2961 for trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Timestamp:
- 03/08/10 00:20:29 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs
r2960 r2961 25 25 using System.Linq; 26 26 using System.Windows.Forms; 27 using HeuristicLab.Core;28 using HeuristicLab.Core.Views;29 27 using HeuristicLab.MainForm; 30 28 … … 48 46 } 49 47 protected override void OnActiveViewChanged(object sender, EventArgs e) { 50 var views = from v in MainFormManager.MainForm.Views 51 where v is IContentView 52 where ((v is ItemView) && ((ItemView)v).EnableFileOperations) || (!(v is ItemView)) 48 var views = from v in MainFormManager.MainForm.Views.OfType<IContentView>() 49 where v.SaveEnabled 53 50 select v; 54 51 ToolStripItem.Enabled = views.FirstOrDefault() != null; -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs
r2960 r2961 23 23 using System.Collections.Generic; 24 24 using System.Windows.Forms; 25 using HeuristicLab.Core;26 using HeuristicLab.Core.Views;27 25 using HeuristicLab.MainForm; 28 26 … … 47 45 protected override void OnActiveViewChanged(object sender, EventArgs e) { 48 46 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 49 bool enable = activeView != null; 50 ItemView itemView = MainFormManager.MainForm.ActiveView as ItemView; 51 if ((enable) && (itemView != null)) enable = itemView.EnableFileOperations; 52 ToolStripItem.Enabled = enable; 47 ToolStripItem.Enabled = (activeView != null) && (activeView.SaveEnabled); 53 48 } 54 49 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs
r2960 r2961 24 24 using System.Drawing; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Core;27 using HeuristicLab.Core.Views;28 26 using HeuristicLab.MainForm; 29 27 … … 51 49 protected override void OnActiveViewChanged(object sender, EventArgs e) { 52 50 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 53 bool enable = activeView != null; 54 ItemView itemView = MainFormManager.MainForm.ActiveView as ItemView; 55 if ((enable) && (itemView != null)) enable = itemView.EnableFileOperations; 56 ToolStripItem.Enabled = enable; 51 ToolStripItem.Enabled = (activeView != null) && (activeView.SaveEnabled); 57 52 } 58 53
Note: See TracChangeset
for help on using the changeset viewer.