AddAfter Method (LinkedListNode(T), LinkedListNode(T))
Collapse the table of content
Expand the table of content

LinkedList<T>.AddAfter Method (LinkedListNode<T>, LinkedListNode<T>)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Adds the specified new node after the specified existing node in the LinkedList<T>.

Namespace:  System.Collections.Generic
Assembly:  System (in System.dll)

public void AddAfter(
	LinkedListNode<T> node,
	LinkedListNode<T> newNode
)

Parameters

node
Type: System.Collections.Generic.LinkedListNode<T>
The LinkedListNode<T> after which to insert newNode.
newNode
Type: System.Collections.Generic.LinkedListNode<T>
The new LinkedListNode<T> to add to the LinkedList<T>.

ExceptionCondition
ArgumentNullException

node is null.

-or-

newNode is null.

InvalidOperationException

node is not in the current LinkedList<T>.

-or-

newNode belongs to another LinkedList<T>.

LinkedList<T> accepts null as a valid Value for reference types and allows duplicate values.

This method is an O(1) operation.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft