Changeset 2958 for trunk/sources/HeuristicLab.Optimizer
- Timestamp:
- 03/07/10 06:40:15 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/FileManager.cs
r2790 r2958 160 160 161 161 foreach (IContentView view in views) { 162 Save(view); 162 ItemView itemView = view as ItemView; 163 if ((itemView == null) || (itemView.EnableFileOperations)) { 164 Save(view); 165 } 163 166 } 164 167 } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs
r2796 r2958 26 26 using System.Windows.Forms; 27 27 using HeuristicLab.Core; 28 using HeuristicLab.Core.Views; 28 29 using HeuristicLab.MainForm; 29 30 … … 50 51 where v is IContentView 51 52 where CreatableAttribute.IsCreatable(((IContentView)v).Content.GetType()) 53 where ((v is ItemView) && ((ItemView)v).EnableFileOperations) || (!(v is ItemView)) 52 54 select v; 53 55 ToolStripItem.Enabled = views.FirstOrDefault() != null; -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs
r2790 r2958 24 24 using System.Windows.Forms; 25 25 using HeuristicLab.Core; 26 using HeuristicLab.Core.Views; 26 27 using HeuristicLab.MainForm; 27 28 … … 46 47 protected override void OnActiveViewChanged(object sender, EventArgs e) { 47 48 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 48 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 49 bool enable = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 50 ItemView itemView = MainFormManager.MainForm.ActiveView as ItemView; 51 if ((enable) && (itemView != null)) enable = itemView.EnableFileOperations; 52 ToolStripItem.Enabled = enable; 49 53 } 50 54 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs
r2796 r2958 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Core.Views; 27 28 using HeuristicLab.MainForm; 28 29 … … 50 51 protected override void OnActiveViewChanged(object sender, EventArgs e) { 51 52 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 52 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 53 bool enable = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 54 ItemView itemView = MainFormManager.MainForm.ActiveView as ItemView; 55 if ((enable) && (itemView != null)) enable = itemView.EnableFileOperations; 56 ToolStripItem.Enabled = enable; 53 57 } 54 58 -
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveAllToolBarItem.cs
r2796 r2958 25 25 using System.Windows.Forms; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Core.Views; 27 28 using HeuristicLab.MainForm; 28 29 … … 49 50 where v is IContentView 50 51 where CreatableAttribute.IsCreatable(((IContentView)v).Content.GetType()) 52 where ((v is ItemView) && ((ItemView)v).EnableFileOperations) || (!(v is ItemView)) 51 53 select v; 52 54 ToolStripItem.Enabled = views.FirstOrDefault() != null; -
trunk/sources/HeuristicLab.Optimizer/3.3/ToolBarItems/SaveToolBarItem.cs
r2796 r2958 24 24 using System.Windows.Forms; 25 25 using HeuristicLab.Core; 26 using HeuristicLab.Core.Views; 26 27 using HeuristicLab.MainForm; 27 28 … … 46 47 protected override void OnActiveViewChanged(object sender, EventArgs e) { 47 48 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 48 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 49 bool enable = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 50 ItemView itemView = MainFormManager.MainForm.ActiveView as ItemView; 51 if ((enable) && (itemView != null)) enable = itemView.EnableFileOperations; 52 ToolStripItem.Enabled = enable; 49 53 } 50 54
Note: See TracChangeset
for help on using the changeset viewer.