Changeset 2543
- Timestamp:
- 12/04/09 15:09:43 (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/MainFormBase.cs
r2541 r2543 55 55 this.initialized = true; 56 56 if (this.Initialized != null) 57 this.Initialized(this, new EventArgs());57 this.Initialized(this, new EventArgs()); 58 58 } 59 59 } … … 154 154 form.GotFocus += new EventHandler(FormActivated); 155 155 form.FormClosing += new FormClosingEventHandler(view.OnClosing); 156 form.FormClosing += new FormClosingEventHandler(((ViewBase)view).OnClosing );156 form.FormClosing += new FormClosingEventHandler(((ViewBase)view).OnClosingHelper); 157 157 form.FormClosed += new FormClosedEventHandler(view.OnClosed); 158 158 form.FormClosed += new FormClosedEventHandler(ChildFormClosed); … … 176 176 if (InvokeRequired) Invoke((Action<IView>)CloseView, view); 177 177 else { 178 if (views.ContainsKey(view)) 178 if (views.ContainsKey(view)) { 179 ((ViewBase)view).closeReason = CloseReason.FormOwnerClosing; 179 180 views[view].Close(); 181 } 180 182 } 181 183 } … … 195 197 form.GotFocus -= new EventHandler(FormActivated); 196 198 form.FormClosing -= new FormClosingEventHandler(view.OnClosing); 197 form.FormClosing -= new FormClosingEventHandler(((ViewBase)view).OnClosing );199 form.FormClosing -= new FormClosingEventHandler(((ViewBase)view).OnClosingHelper); 198 200 form.FormClosed -= new FormClosedEventHandler(view.OnClosed); 199 201 form.FormClosed -= new FormClosedEventHandler(ChildFormClosed); -
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.2/ViewBase.cs
r2541 r2543 35 35 InitializeComponent(); 36 36 this.initialized = false; 37 this.closeReason = CloseReason.None; 37 38 } 38 39 … … 63 64 } 64 65 65 public virtual void OnClosing(object sender, FormClosingEventArgs e) { 66 internal CloseReason closeReason; 67 internal void OnClosingHelper(object sender, FormClosingEventArgs e) { 68 if (this.closeReason != CloseReason.None) 69 this.OnClosing(sender, new FormClosingEventArgs(this.closeReason,e.Cancel)); 70 else 71 this.OnClosing(sender, e); 72 73 this.closeReason = CloseReason.None; 74 } 75 76 public virtual void OnClosing(object sender, FormClosingEventArgs e) { 66 77 } 67 78
Note: See TracChangeset
for help on using the changeset viewer.