public static IEnumerable <System.Windows.Forms.Control> GetControls(System.Windows.Forms.Form _container) { List <System.Windows.Forms.Control> cl = new List <System.Windows.Forms.Control>(); if (_container.HasChildren) { foreach (System.Windows.Forms.Control c in _container.Controls) { cl.AddRange(ControlWrapper.GetControls(c)); } } return(cl); }
public static IEnumerable <FakeControl> GetFakeControls(System.Windows.Forms.Form _container) { List <FakeControl> cl = new List <FakeControl>(); IFakeControlContainer fccontainer = _container as IFakeControlContainer; if (fccontainer != null) { foreach (FakeControl c in fccontainer.Controls) { cl.AddRange(ControlWrapper.GetFakeControls(c)); } } else { if (_container.HasChildren) { foreach (System.Windows.Forms.Control c in _container.Controls) { cl.AddRange(ControlWrapper.GetFakeControls(c)); } } } return(cl); }