Changeset 3301
- Timestamp:
- 04/11/10 19:32:52 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/MainForm.cs
r2963 r3301 31 31 using HeuristicLab.PluginInfrastructure; 32 32 using System.Collections; 33 using WeifenLuo.WinFormsUI.Docking; 33 34 34 35 namespace HeuristicLab.MainForm.WindowsForms { … … 162 163 this.ActiveView = GetView((Form)sender); 163 164 } 165 166 protected override void OnFormClosing(FormClosingEventArgs e) { 167 foreach (KeyValuePair<IView,Form > pair in this.views) { 168 DockForm dockForm = pair.Value as DockForm; 169 View view = pair.Key as View; 170 if (view != null && dockForm != null && dockForm.DockState != DockState.Document) { 171 view.CloseReason = CloseReason.ApplicationExitCall; 172 view.OnClosingHelper(dockForm, e); 173 } 174 } 175 base.OnFormClosing(e); 176 } 177 178 protected override void OnFormClosed(FormClosedEventArgs e) { 179 foreach (KeyValuePair<IView, Form> pair in this.views.ToList()) { 180 DockForm dockForm = pair.Value as DockForm; 181 View view = pair.Key as View; 182 if (view != null && dockForm != null && dockForm.DockState != DockState.Document) { 183 view.CloseReason = CloseReason.ApplicationExitCall; 184 view.OnClosedHelper(dockForm, e); 185 dockForm.Close(); 186 } 187 } 188 base.OnFormClosed(e); 189 } 164 190 #endregion 165 191 … … 188 214 form.Activated += new EventHandler(FormActivated); 189 215 form.FormClosed += new FormClosedEventHandler(ChildFormClosed); 190 216 191 217 } 192 218 this.Show(view, firstTimeShown); -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/View.cs
r3177 r3301 119 119 } 120 120 121 private void OnClosingHelper(object sender, FormClosingEventArgs e) { 121 internal void OnClosingHelper(object sender, FormClosingEventArgs e) { 122 FormClosingEventArgs eventArgs = new FormClosingEventArgs(this.closeReason, e.Cancel); 122 123 if (this.closeReason != CloseReason.None) 123 this.OnClosing( new FormClosingEventArgs(this.closeReason, e.Cancel));124 this.OnClosing(eventArgs); 124 125 else 125 126 this.OnClosing(e); 126 127 128 if (eventArgs.Cancel != e.Cancel) 129 e.Cancel = eventArgs.Cancel; 127 130 this.closeReason = CloseReason.None; 128 131 } … … 131 134 } 132 135 133 privatevoid OnClosedHelper(object sender, FormClosedEventArgs e) {136 internal void OnClosedHelper(object sender, FormClosedEventArgs e) { 134 137 if (this.closeReason != CloseReason.None) 135 138 this.OnClosed(new FormClosedEventArgs(this.closeReason));
Note: See TracChangeset
for help on using the changeset viewer.