- Timestamp:
- 12/14/15 15:21:47 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/DockForm.cs
r12012 r13458 21 21 22 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 23 25 using System.Windows.Forms; 26 using HeuristicLab.Common; 24 27 using WeifenLuo.WinFormsUI.Docking; 25 28 … … 111 114 } 112 115 #endregion 116 117 #region Context Menu Events 118 private void closeToolStripMenuItem_Click(object sender, EventArgs e) { 119 Close(); 120 } 121 private void closeAllToolStripMenuItem_Click(object sender, EventArgs e) { 122 foreach (var dockForm in CurrentDockForms.ToList()) { 123 dockForm.Close(); 124 } 125 } 126 private void closeAllButThisToolStripMenuItem_Click(object sender, EventArgs e) { 127 foreach (var dockForm in CurrentDockForms.Except(this.ToEnumerable()).ToList()) { 128 dockForm.Close(); 129 } 130 } 131 private IEnumerable<DockForm> CurrentDockForms { 132 get { 133 return DockPanel.ActivePane.IsActiveDocumentPane 134 ? DockPanel.Documents.OfType<DockForm>() 135 : DockPanel.ActivePane.Contents.OfType<DockForm>(); 136 // ActivePane.Contents contains all dockforms if ActivePane is the main DocumentPane 137 } 138 } 139 140 private void cloneToolStripMenuItem_Click(object sender, EventArgs e) { 141 var contentView = View as IContentView; 142 if (contentView == null) return; 143 144 var cloneable = contentView.Content as IDeepCloneable; 145 if (cloneable == null) return; 146 147 var clone = (IContent)cloneable.Clone(); 148 MainFormManager.MainForm.ShowContent(clone); 149 } 150 #endregion 113 151 } 114 152 }
Note: See TracChangeset
for help on using the changeset viewer.