- Timestamp:
- 08/09/09 15:55:56 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.Test/3.2/EditorView.cs
r2254 r2266 21 21 this.OnStateChanged(); 22 22 } 23 24 public override void FormClosing(object sender, FormClosingEventArgs e) { 25 if (DialogResult.Yes != MessageBox.Show( 26 "Recent changes have not been saved. Close the editor anyway?", "Close editor?", 27 MessageBoxButtons.YesNo, MessageBoxIcon.Question, 28 MessageBoxDefaultButton.Button2)) { 29 30 e.Cancel = true; 31 32 } 33 } 23 34 } 24 35 } -
trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs
r2256 r2266 48 48 else { 49 49 base.ShowView(view); 50 DockContent content = new DockForm(view); 51 content.Activated += new EventHandler(DockFormActivated); 52 content.FormClosing += new FormClosingEventHandler(DockFormClosing); 50 DockContent dockForm = new DockForm(view); 51 dockForm.Activated += new EventHandler(DockFormActivated); 52 dockForm.FormClosing += new FormClosingEventHandler(view.FormClosing); 53 dockForm.FormClosed += new FormClosedEventHandler(DockFormClosed); 53 54 foreach (IToolStripItem item in ViewChangedToolStripItems) 54 55 view.StateChanged += new EventHandler(item.ViewChanged); 55 content.Show(dockPanel);56 dockForm.Show(dockPanel); 56 57 } 57 58 } 58 59 59 private void DockFormClos ing(object sender, FormClosingEventArgs e) {60 private void DockFormClosed(object sender, FormClosedEventArgs e) { 60 61 DockForm dockForm = (DockForm)sender; 61 62 views.Remove(dockForm.View); … … 63 64 ActiveView = null; 64 65 dockForm.Activated -= new EventHandler(DockFormActivated); 65 dockForm.FormClosing -= new FormClosingEventHandler(DockFormClosing); 66 dockForm.FormClosing -= new FormClosingEventHandler(dockForm.View.FormClosing); 67 dockForm.FormClosed -= new FormClosedEventHandler(DockFormClosed); 66 68 foreach (IToolStripItem item in ViewChangedToolStripItems) 67 69 dockForm.View.StateChanged -= new EventHandler(item.ViewChanged); -
trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IView.cs
r2254 r2266 23 23 using System.Collections.Generic; 24 24 using System.Text; 25 using System.Windows.Forms; 25 26 26 27 namespace HeuristicLab.MainForm { … … 30 31 event EventHandler StateChanged; 31 32 IMainForm MainForm { get; set; } 33 void FormClosing(object sender, FormClosingEventArgs e); 32 34 } 33 35 } -
trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs
r2256 r2266 22 22 MultipleDocumentForm form = new MultipleDocumentForm(view); 23 23 form.Activated += new EventHandler(MultipleDocumentFormActivated); 24 form.FormClosing += new FormClosingEventHandler(MultipleDocumentFormClosing); 24 form.FormClosing += new FormClosingEventHandler(view.FormClosing); 25 form.FormClosed += new FormClosedEventHandler(MultipleDocumentFormClosed); 25 26 form.MdiParent = this; 26 27 foreach (IToolStripItem item in ViewChangedToolStripItems) … … 35 36 } 36 37 37 private void MultipleDocumentFormClos ing(object sender, FormClosingEventArgs e) {38 private void MultipleDocumentFormClosed(object sender, FormClosedEventArgs e) { 38 39 MultipleDocumentForm form = (MultipleDocumentForm)sender; 39 40 views.Remove(form.View); … … 41 42 ActiveView = null; 42 43 form.Activated -= new EventHandler(MultipleDocumentFormActivated); 43 form.FormClosing -= new FormClosingEventHandler(MultipleDocumentFormClosing); 44 form.FormClosing -= new FormClosingEventHandler(form.View.FormClosing); 45 form.FormClosed -= new FormClosedEventHandler(MultipleDocumentFormClosed); 44 46 foreach (IToolStripItem item in ViewChangedToolStripItems) 45 47 form.View.StateChanged -= new EventHandler(item.ViewChanged); -
trunk/sources/HeuristicLab.MainForm/3.2/ViewBase.cs
r2254 r2266 68 68 set { this.mainForm = value; } 69 69 } 70 71 public virtual void FormClosing(object sender, FormClosingEventArgs e) { 72 } 70 73 } 71 74 }
Note: See TracChangeset
for help on using the changeset viewer.