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>.
Assembly: System (in System.dll)
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>.
| Exception | Condition |
|---|---|
| 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.
Show: