Changeset 2713 for trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Timestamp:
- 01/29/10 01:44:57 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseAllMenuItem.cs
r2708 r2713 20 20 get { return 1700; } 21 21 } 22 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {23 get { return ToolStripItemDisplayStyle.Text; }24 }25 22 26 23 protected override void OnToolStripItemSet(EventArgs e) { … … 28 25 } 29 26 protected override void OnActiveViewChanged(object sender, EventArgs e) { 30 ToolStripItem.Enabled = MainFormManager.MainForm.Views. FirstOrDefault() != null;27 ToolStripItem.Enabled = MainFormManager.MainForm.Views.Any<IView>(v => v.IsShown); 31 28 } 32 29 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/CloseMenuItem.cs
r2708 r2713 20 20 get { return 1600; } 21 21 } 22 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {23 get { return ToolStripItemDisplayStyle.Text; }24 }25 22 26 23 protected override void OnToolStripItemSet(EventArgs e) { … … 28 25 } 29 26 protected override void OnActiveViewChanged(object sender, EventArgs e) { 30 ToolStripItem.Enabled = MainFormManager.MainForm. Views.FirstOrDefault()!= null;27 ToolStripItem.Enabled = MainFormManager.MainForm.ActiveView != null; 31 28 } 32 29 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/ExitMenuItem.cs
r2708 r2713 20 20 get { return 1999; } 21 21 } 22 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {23 get { return ToolStripItemDisplayStyle.Text; }24 }25 22 public override Keys ShortCutKeys { 26 23 get { return Keys.Control | Keys.X; } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/NewMenuItem.cs
r2708 r2713 19 19 get { return 1100; } 20 20 } 21 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {22 get { return ToolStripItemDisplayStyle.ImageAndText; }23 }24 21 public override Image Image { 25 22 get { return Resources.NewIcon; } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OpenMenuItem.cs
r2708 r2713 19 19 get { return 1200; } 20 20 } 21 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {22 get { return ToolStripItemDisplayStyle.ImageAndText; }23 }24 21 public override Image Image { 25 22 get { return Resources.OpenIcon; } -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OperatorsMenuItem.cs
r2708 r2713 24 24 public override int Position { 25 25 get { return 2100; } 26 }27 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {28 get { return ToolStripItemDisplayStyle.Text; }29 26 } 30 27 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAllMenuItem.cs
r2708 r2713 22 22 get { return 1500; } 23 23 } 24 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {25 get { return ToolStripItemDisplayStyle.ImageAndText; }26 }27 24 public override Image Image { 28 25 get { return Resources.SaveAllIcon; } … … 34 31 protected override void OnActiveViewChanged(object sender, EventArgs e) { 35 32 var views = from v in MainFormManager.MainForm.Views 36 where v is I ObjectView37 where CreatableAttribute.IsCreatable(((I ObjectView)v).Object.GetType())33 where v is IContentView 34 where CreatableAttribute.IsCreatable(((IContentView)v).Content.GetType()) 38 35 select v; 39 36 ToolStripItem.Enabled = views.FirstOrDefault() != null; -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveAsMenuItem.cs
r2708 r2713 22 22 get { return 1400; } 23 23 } 24 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {25 get { return ToolStripItemDisplayStyle.ImageAndText; }26 }27 24 public override Keys ShortCutKeys { 28 25 get { return Keys.Control | Keys.Shift | Keys.S; } … … 33 30 } 34 31 protected override void OnActiveViewChanged(object sender, EventArgs e) { 35 I ObjectView activeView = MainFormManager.MainForm.ActiveView as IObjectView;36 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView. Object.GetType())));32 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 33 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 37 34 } 38 35 -
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/SaveMenuItem.cs
r2708 r2713 22 22 get { return 1300; } 23 23 } 24 public override ToolStripItemDisplayStyle ToolStripItemDisplayStyle {25 get { return ToolStripItemDisplayStyle.ImageAndText; }26 }27 24 public override Image Image { 28 25 get { return Resources.SaveIcon; } … … 36 33 } 37 34 protected override void OnActiveViewChanged(object sender, EventArgs e) { 38 I ObjectView activeView = MainFormManager.MainForm.ActiveView as IObjectView;39 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView. Object.GetType())));35 IContentView activeView = MainFormManager.MainForm.ActiveView as IContentView; 36 ToolStripItem.Enabled = ((activeView != null) && (CreatableAttribute.IsCreatable(activeView.Content.GetType()))); 40 37 } 41 38
Note: See TracChangeset
for help on using the changeset viewer.