Method InsertAfter
InsertAfter(T, T, IEqualityComparer<T>?)
Searches the list for the first value that is equal to existingValue and adds value after it.
Declaration
public WeakList<T>.Node InsertAfter(T existingValue, T value, IEqualityComparer<T>? comparer = null)
Parameters
| Type | Name | Description |
|---|---|---|
| T | existingValue | The value to search for. |
| T | value | The value to add. |
| IEqualityComparer<T> | comparer | The comparer to use to determine equality, or null to use the default comparer. |
Returns
| Type | Description |
|---|---|
| WeakList<T>.Node | The node that was added. |
Remarks
This operation enumerates the list, so it takes O(n) time plus the cost of the comparisons. Nodes added by other threads during the search are not considered.
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
| ArgumentException |
|
| ObjectDisposedException | The list has been disposed. |