Skip to main content
Version: 4.1

TreeNodeCollection

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a collection of TreeNode objects.

public class TreeNodeCollection : IList, ICollection, IEnumerable, IList<TreeNode>, ICollection<TreeNode>, IEnumerable<TreeNode>

Properties

Instance member Count

Int32: Returns the total number of TreeNode objects in the collection.

Instance member IsReadOnly

Boolean: Returns a value indicating whether the collection is read-only.

Instance member Item(index)

TreeNode: Returns or sets the TreeNode at the specified index in the collection.

Throws:

Instance member Item(key)

TreeNode: Returns the TreeNode with the specified key from the collection.

Methods

Instance member Add(text)

Adds a new tree node with the specified label text to the end of the current TreeNodeCollection.

ParameterTypeDescription
textStringThe label text displayed by the TreeNode.

Returns: TreeNode. A TreeNode that represents the tree node being added to the collection.

Instance member Add(key, text)

Creates a new TreeNode with the specified key and text, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.

Returns: TreeNode. The TreeNode that was added to the collection.

Instance member Add(key, text, imageIndex)

Creates a TreeNode with the specified key, text, and image, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageIndexInt32The index of the image to display in the TreeNode.

Returns: TreeNode. The TreeNode that was added to the collection.

Instance member Add(key, text, imageKey)

Creates a TreeNode with the specified key, text, and image, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageKeyStringThe image to display in the TreeNode.

Returns: TreeNode. The TreeNode that was added to the collection.

Instance member Add(key, text, imageIndex, selectedImageIndex)

Creates a TreeNode with the specified key, text, and images, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageIndexInt32The index of the image to display in the TreeNode.
selectedImageIndexInt32The index of the image to be displayed in the tree node when it is in a selected state.

Returns: TreeNode. The tree node that was added to the collection.

Instance member Add(key, text, imageKey, selectedImageKey)

Creates a TreeNode with the specified key, text, and images, and adds it to the collection.

ParameterTypeDescription
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageKeyStringThe key of the image to display in the TreeNode.
selectedImageKeyStringThe key of the image to display when the node is in a selected state.

Returns: TreeNode. The TreeNode that was added to the collection.

Instance member Add(node)

Adds a previously created TreeNode to the end of the TreeNodeCollection.

ParameterTypeDescription
nodeTreeNodeThe TreeNode to add to the collection.

Returns: Int32. The zero-based index value of the TreeNode added to the TreeNodeCollection.

Throws:

Instance member AddRange(nodes)

Adds an array of previously created TreeNode objects to the collection.

ParameterTypeDescription
nodesTreeNode[]An array of TreeNode objects representing the tree nodes to add to the collection.

Throws:

Instance member Clear()

Removes all tree nodes from the collection.

Instance member Clear(dispose)

Removes and disposes all tree nodes from the collection.

ParameterTypeDescription
disposeBooleanIndicates whether to dispose the tree nodes removed from the collection.

Instance member Contains(node)

Determines whether the specified TreeNode is a member of the collection.

ParameterTypeDescription
nodeTreeNodeThe TreeNode to locate in the collection.

Returns: Boolean. true if the TreeNode is a member of the collection; otherwise, false.

Instance member ContainsKey(key)

Determines whether the collection contains a TreeNode with the specified key.

ParameterTypeDescription
keyStringThe name of the TreeNode to search for.

Returns: Boolean. true to indicate the collection contains a TreeNode with the specified key; otherwise, false.

Instance member CopyTo(dest, index)

Copies the entire collection into an existing array at a specified location within the array.

ParameterTypeDescription
destArrayThe destination array.
indexInt32The index in the destination array at which storing begins.

Instance member Find(key, searchAllChildren)

Finds the TreeNode objects with specified key, optionally searching sub nodes.

ParameterTypeDescription
keyStringThe name of the tree node to search for.
searchAllChildrenBooleantrue to search child nodes of tree nodes; otherwise, false.

Returns: TreeNode[]. An array of TreeNode objects whose Name property matches the specified key.

Instance member GetEnumerator()

Returns an enumerator that can be used to iterate through the TreeNodeCollection.

Returns: IEnumerator<TreeNode>. An IEnumerator that represents the TreeNodeCollection.

Instance member IndexOf(node)

Returns the index of the specified TreeNode in the collection.

ParameterTypeDescription
nodeTreeNodeThe TreeNode to locate in the collection.

Returns: Int32. The zero-based index of the item found in the tree node collection; otherwise, -1.

Instance member IndexOfKey(key)

Returns the index of the first occurrence of a TreeNode with the specified key.

ParameterTypeDescription
keyStringThe name of the tree node to search for.

Returns: Int32. The zero-based index of the first occurrence of a tree node with the specified key, if found; otherwise, -1.

Instance member Insert(index, node)

Inserts an existing tree node into the tree node collection at the specified location.

ParameterTypeDescription
indexInt32The indexed location within the collection to insert the TreeNode.
nodeTreeNodeThe TreeNode to insert into the collection.

Throws:

Instance member Insert(index, text)

Creates a TreeNode with the specified text and inserts it at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the TreeNode.
textStringThe text to display in the TreeNode.

Returns: TreeNode. The TreeNode that was inserted in the collection.

Instance member Insert(index, key, text)

Creates a tree node with the specified text and key, and inserts it into the collection.

ParameterTypeDescription
indexInt32The location within the collection to insert the TreeNode.
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.

Returns: TreeNode. The TreeNode that was inserted in the collection.

Instance member Insert(index, key, text, imageIndex)

Creates a TreeNode with the specified key, text, and image, and inserts it into the collection at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the TreeNode.
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageIndexInt32The index of the image to display in the TreeNode.

Returns: TreeNode. The TreeNode that was inserted in the collection.

Instance member Insert(index, key, text, imageKey)

Creates a TreeNode with the specified key, text, and image, and inserts it into the collection at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the TreeNode.
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageKeyStringThe key of the image to display in the TreeNode.

Returns: TreeNode. The TreeNode that was inserted in the collection.

Instance member Insert(index, key, text, imageIndex, selectedImageIndex)

Creates a TreeNode with the specified key, text, and images, and inserts it into the collection at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the TreeNode.
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageIndexInt32The index of the image to display in the TreeNode.
selectedImageIndexInt32The index of the image to display in the TreeNode when it is in a selected state.

Returns: TreeNode. The TreeNode that was inserted in the collection.

Instance member Insert(index, key, text, imageKey, selectedImageKey)

Creates a TreeNode with the specified key, text, and images, and inserts it into the collection at the specified index.

ParameterTypeDescription
indexInt32The location within the collection to insert the TreeNode.
keyStringThe name of the TreeNode.
textStringThe text to display in the TreeNode.
imageKeyStringThe key of the image to display in the TreeNode.
selectedImageKeyStringThe key of the image to display in the TreeNode when it is in a selected state.

Returns: TreeNode. The TreeNode that was inserted in the collection.

Protected member OnCollectionChanged(action, element)

Fires the CollectionChanged event.

ParameterTypeDescription
actionCollectionChangeActionOne of CollectionChangeAction indicating the reason the collection has changed.
elementObjectThe element that was added or removed from the collection, or null.

Instance member Remove(node)

Removes the specified TreeNode from the TreeNodeCollection.

ParameterTypeDescription
nodeTreeNodeThe TreeNode to remove.

Throws:

Instance member RemoveAt(index)

Removes a tree node from the tree node collection at a specified index.

ParameterTypeDescription
indexInt32The index of the TreeNode to remove.

Instance member RemoveByKey(key)

Removes the TreeNode with the specified key from the collection.

ParameterTypeDescription
keyStringThe name of the tree node to remove from the collection.

Events

Instance member CollectionChanged

CollectionChangeEventHandler Fired when the collection changes.