- Timestamp:
- 06/24/13 20:22:11 (12 years ago)
- Location:
- branches/HivePerformance/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HivePerformance/sources
- Property svn:mergeinfo changed
/trunk/sources merged: 9618,9623-9624,9626,9647-9649,9652
- Property svn:mergeinfo changed
-
branches/HivePerformance/sources/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ControlExtensions.cs
r9539 r9655 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Runtime.InteropServices; 24 25 using System.Windows.Forms; … … 45 46 } 46 47 } 48 49 public static IEnumerable<Control> GetNestedControls(this Control control, Func<Control, bool> condition = null) { 50 if (control == null) yield break; 51 if (condition == null) condition = (c) => true; 52 53 Queue<Control> unprocessed = new Queue<Control>(); 54 unprocessed.Enqueue(control); 55 56 while (unprocessed.Count > 0) { 57 Control c = unprocessed.Dequeue(); 58 if (condition(c)) yield return c; 59 foreach (Control child in c.Controls) 60 unprocessed.Enqueue(child); 61 } 62 } 47 63 } 48 64 } -
branches/HivePerformance/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r9539 r9655 386 386 ToolStripMenuItem item = new ToolStripMenuItem(); 387 387 this.SetToolStripItemProperties(item, menuItem); 388 this.InsertItem(menuItem.Structure, typeof(ToolStripMenuItem), item, menuStrip.Items); 388 389 if (menuItem is MenuItem) { 389 390 MenuItem menuItemBase = (MenuItem)menuItem; … … 392 393 item.DisplayStyle = menuItemBase.ToolStripItemDisplayStyle; 393 394 } 394 this.InsertItem(menuItem.Structure, typeof(ToolStripMenuItem), item, menuStrip.Items);395 395 } 396 396
Note: See TracChangeset
for help on using the changeset viewer.