Class NodeList
- Namespace
- Lime
- Assembly
- Lime.dll
public class NodeList : IList<Node>, ICollection<Node>, IEnumerable<Node>, IList, ICollection, IEnumerable
- Inheritance
-
NodeList
- Implements
- Inherited Members
- Extension Methods
Constructors
NodeList(Node)
public NodeList(Node owner)
Parameters
ownerNode
Properties
Count
Gets the number of elements contained in the ICollection<T>.
public int Count { get; }
Property Value
- int
The number of elements contained in the ICollection<T>.
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
public bool IsReadOnly { get; }
Property Value
- bool
true if the ICollection<T> is read-only; otherwise, false.
this[int]
Gets or sets the element at the specified index.
public Node this[int index] { get; set; }
Parameters
indexintThe zero-based index of the element to get or set.
Property Value
- Node
The element at the specified index.
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the IList<T>.- NotSupportedException
The property is set and the IList<T> is read-only.
Methods
Add(Node)
Adds a Node to the end of this list.
public void Add(Node node)
Parameters
nodeNode
AddRange(params Node[])
public void AddRange(params Node[] collection)
Parameters
collectionNode[]
AddRange(IEnumerable<Node>)
public void AddRange(IEnumerable<Node> collection)
Parameters
collectionIEnumerable<Node>
Clear()
Removes all items from the ICollection<T>.
public void Clear()
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
Contains(Node)
Determines whether the ICollection<T> contains a specific value.
public bool Contains(Node node)
Parameters
nodeNode
Returns
- bool
true if
itemis found in the ICollection<T>; otherwise, false.
CopyTo(Node[], int)
Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
public void CopyTo(Node[] array, int index)
Parameters
arrayNode[]The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.
indexint
Exceptions
- ArgumentNullException
arrayis null.- ArgumentOutOfRangeException
arrayIndexis less than 0.- ArgumentException
The number of elements in the source ICollection<T> is greater than the available space from
arrayIndexto the end of the destinationarray.
GetEnumerator()
Returns Enumerator for this list. This method is preferrable over IEnumerable.GetEnumerator() because it doesn't allocate new memory via boxing.
public NodeList.Enumerator GetEnumerator()
Returns
IndexOf(Node)
Determines the index of a specific item in the IList<T>.
public int IndexOf(Node node)
Parameters
nodeNode
Returns
- int
The index of
itemif found in the list; otherwise, -1.
Insert(int, Node)
Inserts an item to the IList<T> at the specified index.
public void Insert(int index, Node node)
Parameters
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the IList<T>.- NotSupportedException
The IList<T> is read-only.
Move(int, int)
public void Move(int indexFrom, int indexTo)
Parameters
Push(Node)
Adds a Node to the start of this list.
public void Push(Node node)
Parameters
nodeNode
Remove(Node)
Removes the first occurrence of a specific object from the ICollection<T>.
public bool Remove(Node node)
Parameters
nodeNode
Returns
- bool
true if
itemwas successfully removed from the ICollection<T>; otherwise, false. This method also returns false ifitemis not found in the original ICollection<T>.
Exceptions
- NotSupportedException
The ICollection<T> is read-only.
RemoveAll(Predicate<Node>)
public void RemoveAll(Predicate<Node> predicate)
Parameters
RemoveAt(int)
Removes the IList<T> item at the specified index.
public void RemoveAt(int index)
Parameters
indexintThe zero-based index of the item to remove.
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the IList<T>.- NotSupportedException
The IList<T> is read-only.
RemoveRange(int, int)
public void RemoveRange(int index, int count)
Parameters
Sort(Comparison<Node>)
public void Sort(Comparison<Node> comparison)
Parameters
comparisonComparison<Node>
Swap(int, int)
public void Swap(int index1, int index2)
Parameters
TryFind(string)
Searchs for node with provided Id in this list. Returns null if this list doesn't contain sought-for node.
public Node TryFind(string id)
Parameters
idstring