DumpTreeNode() public method

public DumpTreeNode ( ) : TreeNode
return System.Windows.Forms.TreeNode
        private TreeNode DumpTreeNode(SceneObject obj)
        {
            TreeNode           node   = null;
            DumpTreeNodeScript script = obj.GetScript <DumpTreeNodeScript>();

            if (script != null)
            {
                node = script.DumpTreeNode();
            }
            else
            {
                node     = new TreeNode(string.Format("{0}", obj.Name));
                node.Tag = obj;
            }

            // dump children nodes.
            foreach (var item in obj.Children)
            {
                TreeNode child = DumpTreeNode(item);
                if (child != null)
                {
                    node.Nodes.Add(child);
                }
            }

            return(node);
        }
Beispiel #2
0
        private TreeNode DumpTreeNode(SceneObject obj)
        {
            TreeNode           node   = null;
            DumpTreeNodeScript script = obj.GetScript <DumpTreeNodeScript>();

            if (script != null)
            {
                node = script.DumpTreeNode();
            }

            if (node != null)
            {
                foreach (var item in obj.Children)
                {
                    TreeNode child = DumpTreeNode(item);
                    if (child != null)
                    {
                        node.Nodes.Add(child);
                    }
                }
            }

            return(node);
        }