FormExtensions ClassCleanCode C# Libraries v1.2.03 API
Extension methods for recursively building a collection of certain types of OnlineForm elements.
Inheritance Hierarchy

OnlineSystem Object
  CleanCode.Forms FormExtensions

Namespace: CleanCode.Forms
Assembly: CleanCode (in CleanCode.dll) Version: (1.2.03)

public static class FormExtensions

You can do deep searching—searching an entire hierarchy rather than just immediate children—of OnlineControls and OnlineToolStripMenuItems by extending their respective classes with the aptly named All method. I found the former in the useful, short article entitled "LINQ - The Uber FindControl" at

Each method takes as input a collection of the appropriate object and returns an IEnumerable<T> collection of all descendants. In the case of Controls, then, you would typically pass in the collection of direct child Controls placed on a form:

foreach (Control c in myForm.Controls.All()) . . .
foreach (ToolStripMenuItem item in ContextMenuStrip.Items.All()) . . .
In the case of ToolStripMenuItems, you would typically pass in a collection of tool strip items:

Since CleanCode 0.9.26.

See Also