Class
RadLinkedList<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:

cs-api-definition
public class RadLinkedList<T> : ICollection<T>, IEnumerable<T>, ICollection, IEnumerable

Inheritance: objectRadLinkedList<T>

Implements: ICollectionICollection<T>IEnumerableIEnumerable<T>

Constructors

RadLinkedList()

Declaration

cs-api-definition
public RadLinkedList()

Properties

Count

Gets the number of elements contained in the RadLinkedList.

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

The number of elements in the RadLinkedList.

Implements ICollection<T>.Count

First

Gets the first node in the list.

Declaration

cs-api-definition
public RadLinkedListNode<T> First { get; }

Property Value

RadLinkedListNode<T>

IsEmpty

Gets a value indicating whether the linked list is empty.

Declaration

cs-api-definition
public bool IsEmpty { get; }

Property Value

bool

IsReadOnly

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

Declaration

cs-api-definition
public bool IsReadOnly { get; }

Property Value

bool

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

Implements ICollection<T>.IsReadOnly

Last

Gets the last node in the list.

Declaration

cs-api-definition
public RadLinkedListNode<T> Last { get; }

Property Value

RadLinkedListNode<T>

Methods

Add(T)

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

Declaration

cs-api-definition
public void Add(T item)

Parameters

item

T

The item to be added to the linked list.

Implements ICollection<T>.Add(T)

AddAfter(RadLinkedListNode<T>, RadLinkedListNode<T>)

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

Declaration

cs-api-definition
public RadLinkedListNode<T> AddAfter(RadLinkedListNode<T> node, RadLinkedListNode<T> newNode)

Parameters

node

RadLinkedListNode<T>

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

newNode

RadLinkedListNode<T>

The new node to be inserted into the linked list.

Returns

RadLinkedListNode<T>

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

cs-api-definition
public RadLinkedListNode<T> AddAfter(RadLinkedListNode<T> node, T value)

Parameters

node

RadLinkedListNode<T>

The node after which the new value will be inserted.

value

T

The value to be added to the linked list.

Returns

RadLinkedListNode<T>

Returns the newly added node.

AddBefore(RadLinkedListNode<T>, RadLinkedListNode<T>)

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

Declaration

cs-api-definition
public RadLinkedListNode<T> AddBefore(RadLinkedListNode<T> node, RadLinkedListNode<T> newNode)

Parameters

node

RadLinkedListNode<T>

The node before which the new node will be inserted.

newNode

RadLinkedListNode<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.

AddBefore(RadLinkedListNode<T>, T)

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

Declaration

cs-api-definition
public RadLinkedListNode<T> AddBefore(RadLinkedListNode<T> node, T value)

Parameters

node

RadLinkedListNode<T>

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

value

T

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.

AddFirst(RadLinkedListNode<T>)

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

Declaration

cs-api-definition
public RadLinkedListNode<T> AddFirst(RadLinkedListNode<T> node)

Parameters

node

RadLinkedListNode<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.

AddFirst(T)

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

Declaration

cs-api-definition
public RadLinkedListNode<T> AddFirst(T value)

Parameters

value

T

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.

AddLast(RadLinkedListNode<T>)

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

Declaration

cs-api-definition
public RadLinkedListNode<T> AddLast(RadLinkedListNode<T> node)

Parameters

node

RadLinkedListNode<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.

AddLast(T)

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

Declaration

cs-api-definition
public RadLinkedListNode<T> AddLast(T value)

Parameters

value

T

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.

AddRangeAfter(RadLinkedListNode<T>, RadLinkedListNode<T>, RadLinkedListNode<T>)

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

Declaration

cs-api-definition
public void AddRangeAfter(RadLinkedListNode<T> node, RadLinkedListNode<T> rangeStartNode, RadLinkedListNode<T> rangeEndNode)

Parameters

node

RadLinkedListNode<T>

The node after which the range will be added.

rangeStartNode

RadLinkedListNode<T>

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

rangeEndNode

RadLinkedListNode<T>

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

cs-api-definition
public void AddRangeBefore(RadLinkedListNode<T> node, RadLinkedListNode<T> rangeStartNode, RadLinkedListNode<T> rangeEndNode)

Parameters

node

RadLinkedListNode<T>

The starting node of the range to be added.

rangeStartNode

RadLinkedListNode<T>

The ending node of the range to be added.

rangeEndNode

RadLinkedListNode<T>

The node before which the range will be added.

Clear()

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

Declaration

cs-api-definition
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.

Contains(T)

Determines whether the linked list contains a specific value.

Declaration

cs-api-definition
public bool Contains(T item)

Parameters

item

T

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)

CopyTo(T[], int)

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

Declaration

cs-api-definition
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

int

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

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

GetEnumerator()

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

Declaration

cs-api-definition
public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

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

Implements IEnumerable<T>.GetEnumerator()

MoveNodes(RadLinkedList<T>, RadLinkedListNode<T>)

Moves nodes from one linked list to another linked list.

Declaration

cs-api-definition
public void MoveNodes(RadLinkedList<T> fromList, RadLinkedListNode<T> fromNode)

Parameters

fromList

RadLinkedList<T>

The source linked list from which nodes will be moved.

fromNode

RadLinkedListNode<T>

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

cs-api-definition
public void MoveNodes(RadLinkedList<T> fromList, RadLinkedListNode<T> fromNode, RadLinkedListNode<T> toNode)

Parameters

fromList

RadLinkedList<T>

The linked list from which nodes will be moved.

fromNode

RadLinkedListNode<T>

The node that will be moved from the source list.

toNode

RadLinkedListNode<T>

The linked list to which the nodes will be moved.

Remove(RadLinkedListNode<T>)

Removes the specified node from the linked list.

Declaration

cs-api-definition
public void Remove(RadLinkedListNode<T> node)

Parameters

node

RadLinkedListNode<T>

The node to be removed from the linked list.

Remove(T)

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

Declaration

cs-api-definition
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

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)

RemoveFirst()

Removes the first element from the linked list.

Declaration

cs-api-definition
public void RemoveFirst()

RemoveLast()

Removes the last element from the linked list.

Declaration

cs-api-definition
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

cs-api-definition
public void RemoveRange(RadLinkedListNode<T> rangeHead, RadLinkedListNode<T> rangeTail)

Parameters

rangeHead

RadLinkedListNode<T>

The starting node of the range to be removed.

rangeTail

RadLinkedListNode<T>

The ending node of the range to be removed.