Changeset 2961 for trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems
- Timestamp:
- 03/08/10 00:20:29 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveAllToolBarItem.cs
r2960 r2961 24 24 using System.Linq; 25 25 using System.Windows.Forms; 26 using HeuristicLab.Core;27 using HeuristicLab.Core.Views;28 26 using HeuristicLab.MainForm; 29 27 … … 47 45 } 48 46 protected override void OnActiveViewChanged(object sender, EventArgs e) { 49 var views = from v in MainFormManager.MainForm.Views 50 where v is IContentView 51 where ((v is ItemView) && ((ItemView)v).EnableFileOperations) || (!(v is ItemView)) 47 var views = from v in MainFormManager.MainForm.Views.OfType<IContentView>() 48 where v.SaveEnabled 52 49 select v; 53 50 ToolStripItem.Enabled = views.FirstOrDefault() != null; -
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveToolBarItem.cs
r2960 r2961 23 23 using System.Drawing; 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
Note: See TracChangeset
for help on using the changeset viewer.