private void BuildControlTree(TreeNodeCollection parentsNodes, Control control = null) { control = control ?? GameService.Graphics.SpriteScreen; var controlNode = GetOrAddTreeNodeFromObj(parentsNodes, control); if (control is Container container) { foreach (var childControl in container) { BuildControlTree(controlNode.Nodes, childControl); } container.ChildAdded += ContainerOnChildAdded; container.ChildRemoved += ContainerOnChildRemoved; } }