diff --git a/PowerDocu.Common/ControlEntity.cs b/PowerDocu.Common/ControlEntity.cs index 85f6235..ea2f660 100644 --- a/PowerDocu.Common/ControlEntity.cs +++ b/PowerDocu.Common/ControlEntity.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; namespace PowerDocu.Common @@ -22,6 +21,17 @@ public ControlEntity Screen() if (Parent != null) return Parent.Screen(); return null; } + + public static List getAllChildControls(ControlEntity control) + { + List childControls = new List(); + foreach (ControlEntity childControl in control.Children) + { + childControls.Add(childControl); + childControls.AddRange(getAllChildControls(childControl)); + } + return childControls; + } } public class Rule