ClassRadLinkedList<T>
Represents a linked list collection that allows for efficient insertion and removal of elements.
Definition
Namespace:Telerik.Windows.Documents.DocumentStructure
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Type Parameters:
T
Syntax:
public class RadLinkedList<T> : ICollection<T>, IEnumerable<T>, ICollection, IEnumerable
Inheritance: objectRadLinkedList<T>
Implements:
Constructors
RadLinkedList()
Declaration
public RadLinkedList()
Properties
Count
Gets the number of elements contained in the RadLinkedList.
Declaration
public int Count { get; }
Property Value
The number of elements in the RadLinkedList.
Implements
First
Gets the first node in the list.
Declaration
public RadLinkedListNode<T> First { get; }
Property Value
IsEmpty
Gets a value indicating whether the linked list is empty.
IsReadOnly
Gets a value indicating whether the linked list is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
true if the linked list is read-only; otherwise, false.
Implements
Last
Gets the last node in the list.
Declaration
public RadLinkedListNode<T> Last { get; }
Property Value
Methods
Add(T)
Adds a new element of type T to the end of the linked list.
Declaration
public void Add(T item)
Parameters
item
T
The item to be added to the linked list.
Implements
AddAfter(RadLinkedListNode<T>, RadLinkedListNode<T>)
Inserts a new node after a specified existing node in the linked list.
Declaration
public RadLinkedListNode<T> AddAfter(RadLinkedListNode<T> node, RadLinkedListNode<T> newNode)
Parameters
node
The existing node after which the new node will be added.
newNode
The new node to be inserted into the linked list.
Returns
Returns the newly added node.
AddAfter(RadLinkedListNode<T>, T)
Adds a new node containing the specified value after the specified node in the linked list.
Declaration
public RadLinkedListNode<T> AddAfter(RadLinkedListNode<T> node, T value)
Parameters
node
The node after which the new value will be inserted.
value
T
The value to be added to the linked list.
Returns
Returns the newly added node.
AddBefore(RadLinkedListNode<T>, RadLinkedListNode<T>)
Inserts a new node before the specified node in the linked list.
Declaration
public RadLinkedListNode<T> AddBefore(RadLinkedListNode<T> node, RadLinkedListNode<T> newNode)
Parameters
node
The node before which the new node will be inserted.
newNode
The new node to insert into the list.
Returns
Returns the newly added node if the insertion is successful; otherwise, returns null.
AddBefore(RadLinkedListNode<T>, T)
Inserts a new node containing the specified value before the specified existing node in the linked list.
Declaration
public RadLinkedListNode<T> AddBefore(RadLinkedListNode<T> node, T value)
Parameters
node
The existing node before which the new node will be inserted.
value
T
The value to be stored in the newly created node.
Returns
Returns the new node that has been added to the linked list.
AddFirst(RadLinkedListNode<T>)
Adds a new node containing the specified value to the start of the linked list.
Declaration
public RadLinkedListNode<T> AddFirst(RadLinkedListNode<T> node)
Parameters
node
The node to be added to the beginning of the linked list.
Returns
Returns the new node that has been added to the linked list.
AddFirst(T)
Adds a new element at the beginning of the linked list.
Declaration
public RadLinkedListNode<T> AddFirst(T value)
Parameters
value
T
The item to be added to the beginning of the linked list.
Returns
Returns the new node that has been added to the linked list.
AddLast(RadLinkedListNode<T>)
Adds a new node containing the specified value to the end of the linked list.
Declaration
public RadLinkedListNode<T> AddLast(RadLinkedListNode<T> node)
Parameters
node
The node to be added to the end of the linked list.
Returns
Returns the new node that has been added to the linked list.
AddLast(T)
Adds a new element to the end of the linked list.
Declaration
public RadLinkedListNode<T> AddLast(T value)
Parameters
value
T
The value to be added to the end of the linked list.
Returns
Returns the new node that has been added to the linked list.
AddRangeAfter(RadLinkedListNode<T>, RadLinkedListNode<T>, RadLinkedListNode<T>)
Adds a range of nodes after a specified node in the linked list.
Declaration
public void AddRangeAfter(RadLinkedListNode<T> node, RadLinkedListNode<T> rangeStartNode, RadLinkedListNode<T> rangeEndNode)
Parameters
node
The node after which the range will be added.
rangeStartNode
The node that marks the end of the range to be added.
rangeEndNode
The starting node of the range to be added.
AddRangeBefore(RadLinkedListNode<T>, RadLinkedListNode<T>, RadLinkedListNode<T>)
Adds a range of nodes before a specified node in the linked list.
Declaration
public void AddRangeBefore(RadLinkedListNode<T> node, RadLinkedListNode<T> rangeStartNode, RadLinkedListNode<T> rangeEndNode)
Parameters
node
The starting node of the range to be added.
rangeStartNode
The ending node of the range to be added.
rangeEndNode
The node before which the range will be added.
Clear()
Removes all elements from the linked list, resetting its count to zero.
Declaration
public void Clear()
Implements
Remarks
After calling this method, the linked list will be empty, and any references to the removed elements will be discarded.
Contains(T)
Determines whether the linked list contains a specific value.
Declaration
public bool Contains(T item)
Parameters
item
T
The value to locate in the linked list.
Returns
True if the linked list contains an element with the specified value; otherwise, false.
Implements
CopyTo(T[], int)
Copies the elements of the linked list to an array, starting at a specified array index.
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
array
T[]
The one-dimensional array that is the destination of the elements copied from the linked list.
arrayIndex
The zero-based index in the array at which copying begins.
Implements
GetEnumerator()
Provides an enumerator for iterating through the elements of the linked list.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
IEnumerator<T>
An enumerator that can be used to iterate through the linked list.
Implements
MoveNodes(RadLinkedList<T>, RadLinkedListNode<T>)
Moves nodes from one linked list to another linked list.
Declaration
public void MoveNodes(RadLinkedList<T> fromList, RadLinkedListNode<T> fromNode)
Parameters
fromList
The source linked list from which nodes will be moved.
fromNode
The destination linked list to which nodes will be moved.
MoveNodes(RadLinkedList<T>, RadLinkedListNode<T>, RadLinkedListNode<T>)
Moves nodes from one linked list to another linked list.
Declaration
public void MoveNodes(RadLinkedList<T> fromList, RadLinkedListNode<T> fromNode, RadLinkedListNode<T> toNode)
Parameters
fromList
The linked list from which nodes will be moved.
fromNode
The node that will be moved from the source list.
toNode
The linked list to which the nodes will be moved.
Remove(RadLinkedListNode<T>)
Removes the specified node from the linked list.
Declaration
public void Remove(RadLinkedListNode<T> node)
Parameters
node
The node to be removed from the linked list.
Remove(T)
Removes the first occurrence of a specified object from the linked list.
Declaration
public bool Remove(T item)
Parameters
item
T
The object to remove from the linked list. The value can be null for reference types.
Returns
true if the object is successfully removed; otherwise, false. This method also returns false if the object was not found in the linked list.
Implements
RemoveFirst()
Removes the first element from the linked list.
Declaration
public void RemoveFirst()
RemoveLast()
Removes the last element from the linked list.
Declaration
public void RemoveLast()
RemoveRange(RadLinkedListNode<T>, RadLinkedListNode<T>)
Removes a range of nodes from the linked list, beginning at the specified start node and ending at the specified end node.
Declaration
public void RemoveRange(RadLinkedListNode<T> rangeHead, RadLinkedListNode<T> rangeTail)
Parameters
rangeHead
The starting node of the range to be removed.
rangeTail
The ending node of the range to be removed.