Changeset 4084 for trunk/sources
- Timestamp:
- 07/22/10 16:09:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/ViewHost.cs
r4083 r4084 77 77 } 78 78 } 79 80 79 private Control ActiveViewControl { 81 80 get { return ActiveView as Control; } … … 103 102 this.viewsLabel.Enabled = value; 104 103 this.ResumeRepaint(true); 104 } 105 } 106 107 public void ClearCache() { 108 foreach (var cachedView in cachedViews) { 109 if (cachedView.Value != activeView) { 110 Control c = cachedView.Value as Control; 111 if (c != null) { 112 this.Controls.Remove(c); 113 c.Dispose(); 114 } 115 cachedViews.Remove(cachedView.Key); 116 } 105 117 } 106 118 } … … 185 197 } 186 198 199 private void RegisterActiveViewEvents() { 200 activeView.Changed += new EventHandler(activeView_Changed); 201 activeView.CaptionChanged += new EventHandler(activeView_CaptionChanged); 202 } 203 private void DeregisterActiveViewEvents() { 204 activeView.Changed -= new EventHandler(activeView_Changed); 205 activeView.CaptionChanged -= new EventHandler(activeView_CaptionChanged); 206 } 207 private void activeView_CaptionChanged(object sender, EventArgs e) { 208 this.ActiveViewChanged(); 209 } 210 private void activeView_Changed(object sender, EventArgs e) { 211 this.ActiveViewChanged(); 212 } 213 private void ActiveViewChanged() { 214 if (ActiveView != null) { 215 this.Caption = this.ActiveView.Caption; 216 this.Locked = this.ActiveView.Locked; 217 } 218 } 219 187 220 protected override void OnSizeChanged(EventArgs e) { 188 221 //mkommend: solution to resizing issues. taken from http://support.microsoft.com/kb/953934 … … 194 227 base.OnSizeChanged(e); 195 228 this.viewsLabel.Location = new System.Drawing.Point(this.Width - this.viewsLabel.Margin.Right - this.viewsLabel.Width, this.viewsLabel.Margin.Top); 196 }197 198 private void RegisterActiveViewEvents() {199 activeView.Changed += new EventHandler(activeView_Changed);200 activeView.CaptionChanged += new EventHandler(activeView_CaptionChanged);201 }202 private void DeregisterActiveViewEvents() {203 activeView.Changed -= new EventHandler(activeView_Changed);204 activeView.CaptionChanged -= new EventHandler(activeView_CaptionChanged);205 }206 private void activeView_CaptionChanged(object sender, EventArgs e) {207 this.ActiveViewChanged();208 }209 private void activeView_Changed(object sender, EventArgs e) {210 this.ActiveViewChanged();211 }212 private void ActiveViewChanged() {213 if (ActiveView != null) {214 this.Caption = this.ActiveView.Caption;215 this.Locked = this.ActiveView.Locked;216 }217 229 } 218 230
Note: See TracChangeset
for help on using the changeset viewer.