Changeset 3290 for trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems
- Timestamp:
- 04/09/10 02:04:57 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/MenuItems/OperatorsMenuItem.cs
r3163 r3290 48 48 if (menuItem != null) { 49 49 menuItem.CheckOnClick = true; 50 menuItem.Checked = true;50 menuItem.Checked = Properties.Settings.Default.ShowOperatorsSidebar; 51 51 } 52 52 } 53 53 54 54 private void MainForm_ViewShown(object sender, ViewShownEventArgs e) { 55 if ((e.View is OperatorsSidebar) && (menuItem != null)) 55 if ((e.View is OperatorsSidebar) && (menuItem != null)) { 56 56 menuItem.Checked = true; 57 Properties.Settings.Default.ShowOperatorsSidebar = true; 58 Properties.Settings.Default.Save(); 59 } 57 60 } 58 61 private void MainForm_ViewHidden(object sender, ViewEventArgs e) { 59 if ((e.View is OperatorsSidebar) && (menuItem != null)) 62 if ((e.View is OperatorsSidebar) && (menuItem != null)) { 60 63 menuItem.Checked = false; 64 Properties.Settings.Default.ShowOperatorsSidebar = false; 65 Properties.Settings.Default.Save(); 66 } 61 67 } 62 68 63 69 public override void Execute() { 64 70 var view = MainFormManager.MainForm.Views.OfType<OperatorsSidebar>().FirstOrDefault(); 65 if (view.IsShown) 71 if (view == null) { 72 OperatorsSidebar operatorsSidebar = new OperatorsSidebar(); 73 operatorsSidebar.Dock = DockStyle.Left; 74 operatorsSidebar.Show(); 75 } else if (view.IsShown) { 66 76 view.Hide(); 67 else77 } else { 68 78 view.Show(); 79 } 69 80 } 70 81 }
Note: See TracChangeset
for help on using the changeset viewer.