Changeset 2269
- Timestamp:
- 08/10/09 12:06:45 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.Test/3.2/ButtonItems/SaveToolStripButtonItem.cs
r2256 r2269 22 22 } 23 23 24 public override bool ListenActiveViewChanged {25 get { return true; }26 }27 28 24 public override void ActiveViewChanged(object sender, EventArgs e) { 29 25 IMainForm mainform = (IMainForm)sender; … … 34 30 } 35 31 36 public override bool ListenViewChanged {37 get { return true; }38 }39 40 32 public override void ViewChanged(object sender, EventArgs e) { 41 33 this.ToolStripItem.Enabled = !this.ToolStripItem.Enabled; -
trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs
r2268 r2269 50 50 dockForm.FormClosing += new FormClosingEventHandler(view.FormClosing); 51 51 dockForm.FormClosed += new FormClosedEventHandler(DockFormClosed); 52 foreach (IToolStripItem item in ViewChangedToolStripItems)52 foreach (IToolStripItem item in ToolStripItems) 53 53 view.StateChanged += new EventHandler(item.ViewChanged); 54 54 dockForm.Show(dockPanel); … … 64 64 dockForm.FormClosing -= new FormClosingEventHandler(dockForm.View.FormClosing); 65 65 dockForm.FormClosed -= new FormClosedEventHandler(DockFormClosed); 66 foreach (IToolStripItem item in ViewChangedToolStripItems)66 foreach (IToolStripItem item in ToolStripItems) 67 67 dockForm.View.StateChanged -= new EventHandler(item.ViewChanged); 68 68 } -
trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IToolStripItem.cs
r2256 r2269 38 38 ToolStripItem ToolStripItem { get; set; } 39 39 40 bool ListenActiveViewChanged { get; }41 bool ListenViewChanged { get; }42 40 void ActiveViewChanged(object sender, EventArgs e); 43 41 void ViewChanged(object sender, EventArgs e); -
trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs
r2268 r2269 37 37 InitializeComponent(); 38 38 views = new List<IView>(); 39 viewChangeToolStripItems = new List<IToolStripItem>();39 toolStripItems = new List<IToolStripItem>(); 40 40 } 41 41 … … 87 87 } 88 88 89 private List<IToolStripItem> viewChangeToolStripItems;90 protected IEnumerable<IToolStripItem> ViewChangedToolStripItems {91 get { return this. viewChangeToolStripItems; }89 private List<IToolStripItem> toolStripItems; 90 protected IEnumerable<IToolStripItem> ToolStripItems { 91 get { return this.toolStripItems; } 92 92 } 93 93 … … 156 156 } 157 157 158 private ToolStripDropDownItem FindParent(IToolStripItem item, ToolStripItemCollection parentItems) { 158 private ToolStripDropDownItem FindParent(IToolStripItem item, ToolStripItemCollection parentItems) { 159 159 if (String.IsNullOrEmpty(item.Structure)) 160 160 return null; … … 178 178 toolStripItem.Image = iToolStripItem.Image; 179 179 toolStripItem.DisplayStyle = iToolStripItem.DisplayStyle; 180 if (iToolStripItem.ListenActiveViewChanged) 181 this.ActiveViewChanged += new EventHandler(iToolStripItem.ActiveViewChanged); 182 if (iToolStripItem.ListenViewChanged) 183 this.viewChangeToolStripItems.Add(iToolStripItem); 180 this.ActiveViewChanged += new EventHandler(iToolStripItem.ActiveViewChanged); 184 181 toolStripItem.Click += new EventHandler(ToolStripItemClicked); 182 this.toolStripItems.Add(iToolStripItem); 185 183 iToolStripItem.ToolStripItem = toolStripItem; 186 184 } -
trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs
r2268 r2269 57 57 form.FormClosed += new FormClosedEventHandler(MultipleDocumentFormClosed); 58 58 form.MdiParent = this; 59 foreach (IToolStripItem item in ViewChangedToolStripItems)59 foreach (IToolStripItem item in ToolStripItems) 60 60 view.StateChanged += new EventHandler(item.ViewChanged); 61 61 form.Show(); … … 76 76 form.FormClosing -= new FormClosingEventHandler(form.View.FormClosing); 77 77 form.FormClosed -= new FormClosedEventHandler(MultipleDocumentFormClosed); 78 foreach (IToolStripItem item in ViewChangedToolStripItems)78 foreach (IToolStripItem item in ToolStripItems) 79 79 form.View.StateChanged -= new EventHandler(item.ViewChanged); 80 80 } -
trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs
r2268 r2269 47 47 base.ShowView(view); 48 48 DocumentForm form = new DocumentForm(view); 49 form.ShowInTaskbar = true; 49 50 form.Activated += new EventHandler(DockFormActivated); 50 51 form.FormClosing += new FormClosingEventHandler(view.FormClosing); 51 52 form.FormClosed += new FormClosedEventHandler(DockFormClosed); 52 foreach (IToolStripItem item in ViewChangedToolStripItems)53 foreach (IToolStripItem item in ToolStripItems) 53 54 view.StateChanged += new EventHandler(item.ViewChanged); 54 55 form.Show(this); … … 64 65 form.FormClosing -= new FormClosingEventHandler(form.View.FormClosing); 65 66 form.FormClosed -= new FormClosedEventHandler(DockFormClosed); 66 foreach (IToolStripItem item in ViewChangedToolStripItems)67 foreach (IToolStripItem item in ToolStripItems) 67 68 form.View.StateChanged -= new EventHandler(item.ViewChanged); 68 69 } -
trunk/sources/HeuristicLab.MainForm/3.2/ToolStripItemBase.cs
r2256 r2269 56 56 } 57 57 58 public virtual bool ListenActiveViewChanged {59 get { return false; }60 }61 public virtual bool ListenViewChanged {62 get { return false; }63 }64 65 58 public virtual void ActiveViewChanged(object sender, EventArgs e) { 66 59 }
Note: See TracChangeset
for help on using the changeset viewer.