System.Windows.Forms.TreeNodeCollection.Clear C# (CSharp) Method

Clear() public method

public Clear ( ) : void
return void
        public virtual void Clear()
        {
            items.Clear();
            if (owner.TreeView != null)
                owner.TreeView.Refresh();
        }

Usage Example

Example #1
0
        void PerformPopulateNodes(System.Windows.Forms.TreeNodeCollection nodes, ITreeStore item)
        {
            nodes.Clear();
            var count = item.Count;

            for (int i = 0; i < count; i++)
            {
                var child = item[i];
                var node  = new swf.TreeNode
                {
                    Text = child.Text,
                    Name = child.Key,
                    Tag  = child,
                };
                SetImage(child, node);

                if (child.Expandable)
                {
                    if (child.Expanded)
                    {
                        PerformPopulateNodes(node.Nodes, child);
                        node.Expand();
                    }
                    else
                    {
                        node.Nodes.Add(EmptyName, string.Empty);
                    }
                }

                nodes.Add(node);
            }
        }
All Usage Examples Of System.Windows.Forms.TreeNodeCollection::Clear