You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Windows.Forms;
-
- namespace Shadowsocks.Util
- {
- public static class ViewUtils
- {
- public static IEnumerable<TControl> GetChildControls<TControl>(this Control control) where TControl : Control
- {
- if (control.Controls.Count == 0)
- {
- return Enumerable.Empty<TControl>();
- }
-
- var children = control.Controls.OfType<TControl>().ToList();
- return children.SelectMany(GetChildControls<TControl>).Concat(children);
- }
- }
- }
|