private void LayoutRecursive(GraphicalElement element) { element.Layout(); foreach (GraphicalElement child in element.Children) { LayoutRecursive(child); } }
private void LayoutRecursive(GraphicalElement element, ref HashSet <GraphicalElement> updated) { if (updated.Contains(element) == false) { element.Layout(); updated.Add(element); foreach (GraphicalElement child in element.Children) { LayoutRecursive(child, ref updated); } } }