Class TreeNodeCollection<TParent, TChild>
Represents a collection of tree node children
public class TreeNodeCollection<TParent, TChild> : Collection<TChild>, IList<TChild>, ICollection<TChild>, IReadOnlyList<TChild>, IReadOnlyCollection<TChild>, IEnumerable<TChild>, IList, ICollection, IEnumerable where TParent : TreeNodeBase where TChild : TreeNodeBase
Type Parameters
TParentThe type of the parent
TChildThe node to create a collection of
- Inheritance
-
Collection<TChild>TreeNodeCollection<TParent, TChild>
- Implements
-
IList<TChild>ICollection<TChild>IReadOnlyList<TChild>IReadOnlyCollection<TChild>IEnumerable<TChild>
- Inherited Members
Constructors
TreeNodeCollection(TParent)
Creates a new tree node collection with the specified owner
public TreeNodeCollection(TParent owner)
Parameters
ownerTParentThe owner whose children this collection represents
Methods
AssertNoParent(TChild)
Asserts that the provided node is not already added to another tree node.
protected static void AssertNoParent(TChild node)
Parameters
nodeTChildThe node to verify.
Exceptions
- ArgumentException
Occurs if the node is already added to another node.
ClearItems()
protected override void ClearItems()
InsertItem(int, TChild)
protected override void InsertItem(int index, TChild item)
Parameters
indexintitemTChild
RemoveItem(int)
protected override void RemoveItem(int index)
Parameters
indexint
SetItem(int, TChild)
protected override void SetItem(int index, TChild item)
Parameters
indexintitemTChild