Skip to content

Commit

Permalink
Moved function to get all child controls
Browse files Browse the repository at this point in the history
Previously in AppWordDocBuilder.cs
  • Loading branch information
modery committed Nov 30, 2022
1 parent 319303e commit 81916fc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion PowerDocu.Common/ControlEntity.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;

namespace PowerDocu.Common
Expand All @@ -22,6 +21,17 @@ public ControlEntity Screen()
if (Parent != null) return Parent.Screen();
return null;
}

public static List<ControlEntity> getAllChildControls(ControlEntity control)
{
List<ControlEntity> childControls = new List<ControlEntity>();
foreach (ControlEntity childControl in control.Children)
{
childControls.Add(childControl);
childControls.AddRange(getAllChildControls(childControl));
}
return childControls;
}
}

public class Rule
Expand Down

0 comments on commit 81916fc

Please sign in to comment.