New to Telerik UI for WPFStart a free 30-day trial

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:

C#
public class RadLinkedList<T> : ICollection<T>, IEnumerable<T>, ICollection, IEnumerable

Inheritance: objectRadLinkedList<T>

Implements: ICollectionICollection<T>IEnumerableIEnumerable<T>

Constructors

C#
public RadLinkedList()

Properties

Gets the number of elements contained in the RadLinkedList.

C#
public int Count { get; }
Property Value:

The number of elements in the RadLinkedList.

Implements: ICollection<T>.Count

Gets the first node in the list.

C#
public RadLinkedListNode<T> First { get; }

Gets a value indicating whether the linked list is empty.

C#
public bool IsEmpty { get; }

Gets a value indicating whether the linked list is read-only.

C#
public bool IsReadOnly { get; }
Property Value:

true if the linked list is read-only; otherwise, false.

Implements: ICollection<T>.IsReadOnly

Gets the last node in the list.

C#
public RadLinkedListNode<T> Last { get; }

Methods

Adds a new element of type T to the end of the linked list.

C#
public void Add(T item)
Parameters:itemT

The item to be added to the linked list.

Implements: ICollection<T>.Add(T)

Inserts a new node after a specified existing node in the linked list.

C#
public RadLinkedListNode<T> AddAfter(RadLinkedListNode<T> node, RadLinkedListNode<T> newNode)
Parameters:nodeRadLinkedListNode<T>

The existing node after which the new node will be added.

newNodeRadLinkedListNode<T>

The new node to be inserted into the linked list.

Returns:

RadLinkedListNode<T>

Returns the newly added node.

Adds a new node containing the specified value after the specified node in the linked list.

C#
public RadLinkedListNode<T> AddAfter(RadLinkedListNode<T> node, T value)
Parameters:nodeRadLinkedListNode<T>

The node after which the new value will be inserted.

valueT

The value to be added to the linked list.

Returns:

RadLinkedListNode<T>

Returns the newly added node.

Inserts a new node before the specified node in the linked list.

C#
public RadLinkedListNode<T> AddBefore(RadLinkedListNode<T> node, RadLinkedListNode<T> newNode)
Parameters:nodeRadLinkedListNode<T>

The node before which the new node will be inserted.

newNodeRadLinkedListNode<T>

The new node to insert into the list.

Returns:

RadLinkedListNode<T>

Returns the newly added node if the insertion is successful; otherwise, returns null.

Inserts a new node containing the specified value before the specified existing node in the linked list.

C#
public RadLinkedListNode<T> AddBefore(RadLinkedListNode<T> node, T value)
Parameters:nodeRadLinkedListNode<T>

The existing node before which the new node will be inserted.

valueT

The value to be stored in the newly created node.

Returns:

RadLinkedListNode<T>

Returns the new node that has been added to the linked list.

Adds a new node containing the specified value to the start of the linked list.

C#
public RadLinkedListNode<T> AddFirst(RadLinkedListNode<T> node)
Parameters:nodeRadLinkedListNode<T>

The node to be added to the beginning of the linked list.

Returns:

RadLinkedListNode<T>

Returns the new node that has been added to the linked list.

Adds a new element at the beginning of the linked list.

C#
public RadLinkedListNode<T> AddFirst(T value)
Parameters:valueT

The item to be added to the beginning of the linked list.

Returns:

RadLinkedListNode<T>

Returns the new node that has been added to the linked list.

Adds a new node containing the specified value to the end of the linked list.

C#
public RadLinkedListNode<T> AddLast(RadLinkedListNode<T> node)
Parameters:nodeRadLinkedListNode<T>

The node to be added to the end of the linked list.

Returns:

RadLinkedListNode<T>

Returns the new node that has been added to the linked list.

Adds a new element to the end of the linked list.

C#
public RadLinkedListNode<T> AddLast(T value)
Parameters:valueT

The value to be added to the end of the linked list.

Returns:

RadLinkedListNode<T>

Returns the new node that has been added to the linked list.

Adds a range of nodes after a specified node in the linked list.

C#
public void AddRangeAfter(RadLinkedListNode<T> node, RadLinkedListNode<T> rangeStartNode, RadLinkedListNode<T> rangeEndNode)
Parameters:nodeRadLinkedListNode<T>

The node after which the range will be added.

rangeStartNodeRadLinkedListNode<T>

The node that marks the end of the range to be added.

rangeEndNodeRadLinkedListNode<T>

The starting node of the range to be added.

Adds a range of nodes before a specified node in the linked list.

C#
public void AddRangeBefore(RadLinkedListNode<T> node, RadLinkedListNode<T> rangeStartNode, RadLinkedListNode<T> rangeEndNode)
Parameters:nodeRadLinkedListNode<T>

The starting node of the range to be added.

rangeStartNodeRadLinkedListNode<T>

The ending node of the range to be added.

rangeEndNodeRadLinkedListNode<T>

The node before which the range will be added.

Removes all elements from the linked list, resetting its count to zero.

C#
public void Clear()

Implements: ICollection<T>.Clear()

Remarks:

After calling this method, the linked list will be empty, and any references to the removed elements will be discarded.

Determines whether the linked list contains a specific value.

C#
public bool Contains(T item)
Parameters:itemT

The value to locate in the linked list.

Returns:

bool

True if the linked list contains an element with the specified value; otherwise, false.

Implements: ICollection<T>.Contains(T)

Copies the elements of the linked list to an array, starting at a specified array index.

C#
public void CopyTo(T[] array, int arrayIndex)
Parameters:arrayT[]

The one-dimensional array that is the destination of the elements copied from the linked list.

arrayIndexint

The zero-based index in the array at which copying begins.

Implements: ICollection<T>.CopyTo(T[], int)

Provides an enumerator for iterating through the elements of the linked list.

C#
public IEnumerator<T> GetEnumerator()
Returns:

IEnumerator<T>

An enumerator that can be used to iterate through the linked list.

Implements: IEnumerable<T>.GetEnumerator()

Moves nodes from one linked list to another linked list.

C#
public void MoveNodes(RadLinkedList<T> fromList, RadLinkedListNode<T> fromNode, RadLinkedListNode<T> toNode)
Parameters:fromListRadLinkedList<T>

The linked list from which nodes will be moved.

fromNodeRadLinkedListNode<T>

The node that will be moved from the source list.

toNodeRadLinkedListNode<T>

The linked list to which the nodes will be moved.

Moves nodes from one linked list to another linked list.

C#
public void MoveNodes(RadLinkedList<T> fromList, RadLinkedListNode<T> fromNode)
Parameters:fromListRadLinkedList<T>

The source linked list from which nodes will be moved.

fromNodeRadLinkedListNode<T>

The destination linked list to which nodes will be moved.

Removes the specified node from the linked list.

C#
public void Remove(RadLinkedListNode<T> node)
Parameters:nodeRadLinkedListNode<T>

The node to be removed from the linked list.

Removes the first occurrence of a specified object from the linked list.

C#
public bool Remove(T item)
Parameters:itemT

The object to remove from the linked list. The value can be null for reference types.

Returns:

bool

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: ICollection<T>.Remove(T)

Removes the first element from the linked list.

C#
public void RemoveFirst()

Removes the last element from the linked list.

C#
public void RemoveLast()

Removes a range of nodes from the linked list, beginning at the specified start node and ending at the specified end node.

C#
public void RemoveRange(RadLinkedListNode<T> rangeHead, RadLinkedListNode<T> rangeTail)
Parameters:rangeHeadRadLinkedListNode<T>

The starting node of the range to be removed.

rangeTailRadLinkedListNode<T>

The ending node of the range to be removed.