- Timestamp:
- 08/21/09 14:18:29 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.MainForm/3.2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm/3.2/DockingMainForm.cs
r2297 r2305 56 56 } 57 57 58 public override void CloseView(IView view) { 59 DockForm dockform = null; 60 IEnumerable<DockForm> dockforms; 61 62 if (dockPanel.Documents.Count() != 0) { 63 dockforms = dockPanel.Documents.Cast<DockForm>().Where(df => df.View == view); 64 if (dockforms.Count() == 1) 65 dockform = dockforms.Single(); 66 } 67 if (dockPanel.FloatWindows.Count() != 0) { 68 foreach (FloatWindow fw in dockPanel.FloatWindows) { 69 foreach (DockContentCollection dc in fw.NestedPanes.Select(np => np.Contents)) { 70 dockforms = dc.Cast<DockForm>().Where(df => df.View == view); 71 if (dockforms.Count() == 1) { 72 dockform = dockforms.Single(); 73 break; 74 } 75 } 76 } 77 } 78 if (dockPanel.DockWindows.Count != 0) { 79 foreach (DockWindow dw in dockPanel.DockWindows) { 80 foreach (DockContentCollection dc in dw.NestedPanes.Select(np => np.Contents)) { 81 dockforms = dc.Cast<DockForm>().Where(df => df.View == view); 82 if (dockforms.Count() == 1) { 83 dockform = dockforms.Single(); 84 break; 85 } 86 } 87 } 88 } 89 if (dockform != null) 90 dockform.Close(); 91 } 92 58 93 private void DockFormClosed(object sender, FormClosedEventArgs e) { 59 94 DockForm dockForm = (DockForm)sender; -
trunk/sources/HeuristicLab.MainForm/3.2/Interfaces/IMainForm.cs
r2300 r2305 39 39 Type UserInterfaceItemType { get; } 40 40 void ShowView(IView view); 41 void CloseView(IView view); 42 void CloseAllViews(); 41 43 void Close(); 42 44 } -
trunk/sources/HeuristicLab.MainForm/3.2/MainFormBase.cs
r2302 r2305 117 117 views.Add(view); 118 118 ActiveView = view; 119 } 120 121 public virtual void CloseView(IView view) { 122 } 123 124 public virtual void CloseAllViews() { 125 foreach (IView view in views.ToArray()) 126 CloseView(view); 119 127 } 120 128 -
trunk/sources/HeuristicLab.MainForm/3.2/MultipleDocumentMainForm.cs
r2297 r2305 63 63 } 64 64 65 public override void CloseView(IView view) { 66 DocumentForm documentForm = this.MdiChildren.Cast<DocumentForm>().Where(df => df.View == view).Single(); 67 documentForm.Close(); 68 } 69 65 70 private void MultipleDocumentFormActivated(object sender, EventArgs e) { 66 71 base.ActiveView = ((DocumentForm)sender).View; -
trunk/sources/HeuristicLab.MainForm/3.2/SingleDocumentMainForm.cs
r2297 r2305 57 57 } 58 58 59 public override void CloseView(IView view) { 60 DocumentForm documentForm = this.OwnedForms.Cast<DocumentForm>().Where(df => df.View == view).Single(); 61 documentForm.Close(); 62 } 63 59 64 private void DockFormClosed(object sender, FormClosedEventArgs e) { 60 65 DocumentForm form = (DocumentForm)sender;
Note: See TracChangeset
for help on using the changeset viewer.