From 81916fca9fc906a0599b41c55efa6d5de1d89517 Mon Sep 17 00:00:00 2001 From: Rene Modery Date: Wed, 30 Nov 2022 10:48:57 +0800 Subject: [PATCH] Moved function to get all child controls Previously in AppWordDocBuilder.cs --- PowerDocu.Common/ControlEntity.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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