Example #1
0
        /// <summary>
        /// Flattens the tree recursively.
        /// </summary>
        /// <param name="flattendNodes">The flattened nodes.</param>
        /// <param name="depth">The depth.</param>
        private void FlattenTree(ref Collection <TreeViewNodeFlat> flattendNodes, int depth)
        {
            var flat = new TreeViewNodeFlat
            {
                Node  = this,
                Depth = depth
            };

            flattendNodes.Add(flat);

            depth = depth + 1;
            foreach (var child in this.Children)
            {
                var treeViewNode = child as TreeViewNode;
                if (treeViewNode == null)
                {
                    continue;
                }

                treeViewNode.FlattenTree(ref flattendNodes, depth);
            }
        }
Example #2
0
        /// <summary>
        /// Flattens the tree recursively.
        /// </summary>
        /// <param name="flattendNodes">The flattened nodes.</param>
        /// <param name="depth">The depth.</param>
        private void FlattenTree(ref Collection<TreeViewNodeFlat> flattendNodes, int depth)
        {
            var flat = new TreeViewNodeFlat
            {
                Node = this, 
                Depth = depth
            };
            flattendNodes.Add(flat);

            depth = depth + 1;
            foreach (var child in this.Children)
            {
                var treeViewNode = child as TreeViewNode;
                if (treeViewNode == null)
                {
                    continue;
                }

                treeViewNode.FlattenTree(ref flattendNodes, depth);
            }
        }