mscorlib(4.0.0.0) API with additions
LinkedList.cs
1 using System.Diagnostics;
5 using System.Threading;
6 
8 {
11  [Serializable]
12  [ComVisible(false)]
13  [DebuggerTypeProxy(typeof(System_CollectionDebugView<>))]
14  [DebuggerDisplay("Count = {Count}")]
15  [global::__DynamicallyInvokable]
17  {
19  [Serializable]
20  [global::__DynamicallyInvokable]
22  {
23  private LinkedList<T> list;
24 
25  private LinkedListNode<T> node;
26 
27  private int version;
28 
29  private T current;
30 
31  private int index;
32 
33  private SerializationInfo siInfo;
34 
35  private const string LinkedListName = "LinkedList";
36 
37  private const string CurrentValueName = "Current";
38 
39  private const string VersionName = "Version";
40 
41  private const string IndexName = "Index";
42 
45  [global::__DynamicallyInvokable]
46  public T Current
47  {
48  [global::__DynamicallyInvokable]
49  get
50  {
51  return current;
52  }
53  }
54 
58  [global::__DynamicallyInvokable]
59  object IEnumerator.Current
60  {
61  [global::__DynamicallyInvokable]
62  get
63  {
64  if (index == 0 || index == list.Count + 1)
65  {
66  System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen);
67  }
68  return current;
69  }
70  }
71 
72  internal Enumerator(LinkedList<T> list)
73  {
74  this.list = list;
75  version = list.version;
76  node = list.head;
77  current = default(T);
78  index = 0;
79  siInfo = null;
80  }
81 
82  internal Enumerator(SerializationInfo info, StreamingContext context)
83  {
84  siInfo = info;
85  list = null;
86  version = 0;
87  node = null;
88  current = default(T);
89  index = 0;
90  }
91 
96  [global::__DynamicallyInvokable]
97  public bool MoveNext()
98  {
99  if (version != list.version)
100  {
101  throw new InvalidOperationException(SR.GetString("InvalidOperation_EnumFailedVersion"));
102  }
103  if (node == null)
104  {
105  index = list.Count + 1;
106  return false;
107  }
108  index++;
109  current = node.item;
110  node = node.next;
111  if (node == list.head)
112  {
113  node = null;
114  }
115  return true;
116  }
117 
120  [global::__DynamicallyInvokable]
122  {
123  if (version != list.version)
124  {
125  throw new InvalidOperationException(SR.GetString("InvalidOperation_EnumFailedVersion"));
126  }
127  current = default(T);
128  node = list.head;
129  index = 0;
130  }
131 
133  [global::__DynamicallyInvokable]
134  public void Dispose()
135  {
136  }
137 
144  {
145  if (info == null)
146  {
147  throw new ArgumentNullException("info");
148  }
149  info.AddValue("LinkedList", list);
150  info.AddValue("Version", version);
151  info.AddValue("Current", current);
152  info.AddValue("Index", index);
153  }
154 
159  {
160  if (list != null)
161  {
162  return;
163  }
164  if (siInfo == null)
165  {
166  throw new SerializationException(SR.GetString("Serialization_InvalidOnDeser"));
167  }
168  list = (LinkedList<T>)siInfo.GetValue("LinkedList", typeof(LinkedList<T>));
169  version = siInfo.GetInt32("Version");
170  current = (T)siInfo.GetValue("Current", typeof(T));
171  index = siInfo.GetInt32("Index");
172  if (list.siInfo != null)
173  {
174  list.OnDeserialization(sender);
175  }
176  if (index == list.Count + 1)
177  {
178  node = null;
179  }
180  else
181  {
182  node = list.First;
183  if (node != null && index != 0)
184  {
185  for (int i = 0; i < index; i++)
186  {
187  node = node.next;
188  }
189  if (node == list.First)
190  {
191  node = null;
192  }
193  }
194  }
195  siInfo = null;
196  }
197  }
198 
199  internal LinkedListNode<T> head;
200 
201  internal int count;
202 
203  internal int version;
204 
205  private object _syncRoot;
206 
207  private SerializationInfo siInfo;
208 
209  private const string VersionName = "Version";
210 
211  private const string CountName = "Count";
212 
213  private const string ValuesName = "Data";
214 
217  [global::__DynamicallyInvokable]
218  public int Count
219  {
220  [global::__DynamicallyInvokable]
221  get
222  {
223  return count;
224  }
225  }
226 
229  [global::__DynamicallyInvokable]
230  public LinkedListNode<T> First
231  {
232  [global::__DynamicallyInvokable]
233  get
234  {
235  return head;
236  }
237  }
238 
241  [global::__DynamicallyInvokable]
242  public LinkedListNode<T> Last
243  {
244  [global::__DynamicallyInvokable]
245  get
246  {
247  if (head != null)
248  {
249  return head.prev;
250  }
251  return null;
252  }
253  }
254 
258  [global::__DynamicallyInvokable]
259  bool ICollection<T>.IsReadOnly
260  {
261  [global::__DynamicallyInvokable]
262  get
263  {
264  return false;
265  }
266  }
267 
271  [global::__DynamicallyInvokable]
272  bool ICollection.IsSynchronized
273  {
274  [global::__DynamicallyInvokable]
275  get
276  {
277  return false;
278  }
279  }
280 
283  [global::__DynamicallyInvokable]
284  object ICollection.SyncRoot
285  {
286  [global::__DynamicallyInvokable]
287  get
288  {
289  if (_syncRoot == null)
290  {
291  Interlocked.CompareExchange<object>(ref _syncRoot, new object(), (object)null);
292  }
293  return _syncRoot;
294  }
295  }
296 
298  [global::__DynamicallyInvokable]
299  public LinkedList()
300  {
301  }
302 
307  [global::__DynamicallyInvokable]
308  public LinkedList(IEnumerable<T> collection)
309  {
310  if (collection == null)
311  {
312  throw new ArgumentNullException("collection");
313  }
314  foreach (T item in collection)
315  {
316  AddLast(item);
317  }
318  }
319 
324  {
325  siInfo = info;
326  }
327 
330  [global::__DynamicallyInvokable]
331  void ICollection<T>.Add(T value)
332  {
333  AddLast(value);
334  }
335 
344  [global::__DynamicallyInvokable]
346  {
347  ValidateNode(node);
348  LinkedListNode<T> linkedListNode = new LinkedListNode<T>(node.list, value);
349  InternalInsertNodeBefore(node.next, linkedListNode);
350  return linkedListNode;
351  }
352 
362  [global::__DynamicallyInvokable]
363  public void AddAfter(LinkedListNode<T> node, LinkedListNode<T> newNode)
364  {
365  ValidateNode(node);
366  ValidateNewNode(newNode);
367  InternalInsertNodeBefore(node.next, newNode);
368  newNode.list = this;
369  }
370 
379  [global::__DynamicallyInvokable]
381  {
382  ValidateNode(node);
383  LinkedListNode<T> linkedListNode = new LinkedListNode<T>(node.list, value);
384  InternalInsertNodeBefore(node, linkedListNode);
385  if (node == head)
386  {
387  head = linkedListNode;
388  }
389  return linkedListNode;
390  }
391 
401  [global::__DynamicallyInvokable]
402  public void AddBefore(LinkedListNode<T> node, LinkedListNode<T> newNode)
403  {
404  ValidateNode(node);
405  ValidateNewNode(newNode);
406  InternalInsertNodeBefore(node, newNode);
407  newNode.list = this;
408  if (node == head)
409  {
410  head = newNode;
411  }
412  }
413 
417  [global::__DynamicallyInvokable]
418  public LinkedListNode<T> AddFirst(T value)
419  {
420  LinkedListNode<T> linkedListNode = new LinkedListNode<T>(this, value);
421  if (head == null)
422  {
423  InternalInsertNodeToEmptyList(linkedListNode);
424  }
425  else
426  {
427  InternalInsertNodeBefore(head, linkedListNode);
428  head = linkedListNode;
429  }
430  return linkedListNode;
431  }
432 
439  [global::__DynamicallyInvokable]
440  public void AddFirst(LinkedListNode<T> node)
441  {
442  ValidateNewNode(node);
443  if (head == null)
444  {
445  InternalInsertNodeToEmptyList(node);
446  }
447  else
448  {
449  InternalInsertNodeBefore(head, node);
450  head = node;
451  }
452  node.list = this;
453  }
454 
458  [global::__DynamicallyInvokable]
459  public LinkedListNode<T> AddLast(T value)
460  {
461  LinkedListNode<T> linkedListNode = new LinkedListNode<T>(this, value);
462  if (head == null)
463  {
464  InternalInsertNodeToEmptyList(linkedListNode);
465  }
466  else
467  {
468  InternalInsertNodeBefore(head, linkedListNode);
469  }
470  return linkedListNode;
471  }
472 
479  [global::__DynamicallyInvokable]
480  public void AddLast(LinkedListNode<T> node)
481  {
482  ValidateNewNode(node);
483  if (head == null)
484  {
485  InternalInsertNodeToEmptyList(node);
486  }
487  else
488  {
489  InternalInsertNodeBefore(head, node);
490  }
491  node.list = this;
492  }
493 
495  [global::__DynamicallyInvokable]
496  public void Clear()
497  {
498  LinkedListNode<T> next = head;
499  while (next != null)
500  {
501  LinkedListNode<T> linkedListNode = next;
502  next = next.Next;
503  linkedListNode.Invalidate();
504  }
505  head = null;
506  count = 0;
507  version++;
508  }
509 
514  [global::__DynamicallyInvokable]
515  public bool Contains(T value)
516  {
517  return Find(value) != null;
518  }
519 
528  [global::__DynamicallyInvokable]
529  public void CopyTo(T[] array, int index)
530  {
531  if (array == null)
532  {
533  throw new ArgumentNullException("array");
534  }
535  if (index < 0 || index > array.Length)
536  {
537  throw new ArgumentOutOfRangeException("index", SR.GetString("IndexOutOfRange", index));
538  }
539  if (array.Length - index < Count)
540  {
541  throw new ArgumentException(SR.GetString("Arg_InsufficientSpace"));
542  }
543  LinkedListNode<T> next = head;
544  if (next != null)
545  {
546  do
547  {
548  array[index++] = next.item;
549  next = next.next;
550  }
551  while (next != head);
552  }
553  }
554 
558  [global::__DynamicallyInvokable]
559  public LinkedListNode<T> Find(T value)
560  {
561  LinkedListNode<T> next = head;
563  if (next != null)
564  {
565  if (value != null)
566  {
567  do
568  {
569  if (@default.Equals(next.item, value))
570  {
571  return next;
572  }
573  next = next.next;
574  }
575  while (next != head);
576  }
577  else
578  {
579  do
580  {
581  if (next.item == null)
582  {
583  return next;
584  }
585  next = next.next;
586  }
587  while (next != head);
588  }
589  }
590  return null;
591  }
592 
596  [global::__DynamicallyInvokable]
597  public LinkedListNode<T> FindLast(T value)
598  {
599  if (head == null)
600  {
601  return null;
602  }
603  LinkedListNode<T> prev = head.prev;
604  LinkedListNode<T> linkedListNode = prev;
606  if (linkedListNode != null)
607  {
608  if (value != null)
609  {
610  do
611  {
612  if (@default.Equals(linkedListNode.item, value))
613  {
614  return linkedListNode;
615  }
616  linkedListNode = linkedListNode.prev;
617  }
618  while (linkedListNode != prev);
619  }
620  else
621  {
622  do
623  {
624  if (linkedListNode.item == null)
625  {
626  return linkedListNode;
627  }
628  linkedListNode = linkedListNode.prev;
629  }
630  while (linkedListNode != prev);
631  }
632  }
633  return null;
634  }
635 
638  [global::__DynamicallyInvokable]
639  public Enumerator GetEnumerator()
640  {
641  return new Enumerator(this);
642  }
643 
646  [global::__DynamicallyInvokable]
648  {
649  return GetEnumerator();
650  }
651 
656  [global::__DynamicallyInvokable]
657  public bool Remove(T value)
658  {
659  LinkedListNode<T> linkedListNode = Find(value);
660  if (linkedListNode != null)
661  {
662  InternalRemoveNode(linkedListNode);
663  return true;
664  }
665  return false;
666  }
667 
674  [global::__DynamicallyInvokable]
675  public void Remove(LinkedListNode<T> node)
676  {
677  ValidateNode(node);
678  InternalRemoveNode(node);
679  }
680 
683  [global::__DynamicallyInvokable]
684  public void RemoveFirst()
685  {
686  if (head == null)
687  {
688  throw new InvalidOperationException(SR.GetString("LinkedListEmpty"));
689  }
690  InternalRemoveNode(head);
691  }
692 
695  [global::__DynamicallyInvokable]
696  public void RemoveLast()
697  {
698  if (head == null)
699  {
700  throw new InvalidOperationException(SR.GetString("LinkedListEmpty"));
701  }
702  InternalRemoveNode(head.prev);
703  }
704 
710  [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.SerializationFormatter)]
711  public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
712  {
713  if (info == null)
714  {
715  throw new ArgumentNullException("info");
716  }
717  info.AddValue("Version", version);
718  info.AddValue("Count", count);
719  if (count != 0)
720  {
721  T[] array = new T[Count];
722  CopyTo(array, 0);
723  info.AddValue("Data", array, typeof(T[]));
724  }
725  }
726 
730  public virtual void OnDeserialization(object sender)
731  {
732  if (siInfo == null)
733  {
734  return;
735  }
736  int @int = siInfo.GetInt32("Version");
737  if (siInfo.GetInt32("Count") != 0)
738  {
739  T[] array = (T[])siInfo.GetValue("Data", typeof(T[]));
740  if (array == null)
741  {
742  throw new SerializationException(SR.GetString("Serialization_MissingValues"));
743  }
744  for (int i = 0; i < array.Length; i++)
745  {
746  AddLast(array[i]);
747  }
748  }
749  else
750  {
751  head = null;
752  }
753  version = @int;
754  siInfo = null;
755  }
756 
757  private void InternalInsertNodeBefore(LinkedListNode<T> node, LinkedListNode<T> newNode)
758  {
759  newNode.next = node;
760  newNode.prev = node.prev;
761  node.prev.next = newNode;
762  node.prev = newNode;
763  version++;
764  count++;
765  }
766 
767  private void InternalInsertNodeToEmptyList(LinkedListNode<T> newNode)
768  {
769  newNode.next = newNode;
770  newNode.prev = newNode;
771  head = newNode;
772  version++;
773  count++;
774  }
775 
776  internal void InternalRemoveNode(LinkedListNode<T> node)
777  {
778  if (node.next == node)
779  {
780  head = null;
781  }
782  else
783  {
784  node.next.prev = node.prev;
785  node.prev.next = node.next;
786  if (head == node)
787  {
788  head = node.next;
789  }
790  }
791  node.Invalidate();
792  count--;
793  version++;
794  }
795 
796  internal void ValidateNewNode(LinkedListNode<T> node)
797  {
798  if (node == null)
799  {
800  throw new ArgumentNullException("node");
801  }
802  if (node.list != null)
803  {
804  throw new InvalidOperationException(SR.GetString("LinkedListNodeIsAttached"));
805  }
806  }
807 
808  internal void ValidateNode(LinkedListNode<T> node)
809  {
810  if (node == null)
811  {
812  throw new ArgumentNullException("node");
813  }
814  if (node.list != this)
815  {
816  throw new InvalidOperationException(SR.GetString("ExternalLinkedListNode"));
817  }
818  }
819 
830  [global::__DynamicallyInvokable]
831  void ICollection.CopyTo(Array array, int index)
832  {
833  if (array == null)
834  {
835  throw new ArgumentNullException("array");
836  }
837  if (array.Rank != 1)
838  {
839  throw new ArgumentException(SR.GetString("Arg_MultiRank"));
840  }
841  if (array.GetLowerBound(0) != 0)
842  {
843  throw new ArgumentException(SR.GetString("Arg_NonZeroLowerBound"));
844  }
845  if (index < 0)
846  {
847  throw new ArgumentOutOfRangeException("index", SR.GetString("IndexOutOfRange", index));
848  }
849  if (array.Length - index < Count)
850  {
851  throw new ArgumentException(SR.GetString("Arg_InsufficientSpace"));
852  }
853  T[] array2 = array as T[];
854  if (array2 != null)
855  {
856  CopyTo(array2, index);
857  return;
858  }
859  Type elementType = array.GetType().GetElementType();
860  Type typeFromHandle = typeof(T);
861  if (!elementType.IsAssignableFrom(typeFromHandle) && !typeFromHandle.IsAssignableFrom(elementType))
862  {
863  throw new ArgumentException(SR.GetString("Invalid_Array_Type"));
864  }
865  object[] array3 = array as object[];
866  if (array3 == null)
867  {
868  throw new ArgumentException(SR.GetString("Invalid_Array_Type"));
869  }
870  LinkedListNode<T> next = head;
871  try
872  {
873  if (next != null)
874  {
875  do
876  {
877  array3[index++] = next.item;
878  next = next.next;
879  }
880  while (next != head);
881  }
882  }
883  catch (ArrayTypeMismatchException)
884  {
885  throw new ArgumentException(SR.GetString("Invalid_Array_Type"));
886  }
887  }
888 
891  [global::__DynamicallyInvokable]
892  IEnumerator IEnumerable.GetEnumerator()
893  {
894  return GetEnumerator();
895  }
896  }
897 }
LinkedListNode< T > Last
Gets the last node of the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:243
LinkedList(SerializationInfo info, StreamingContext context)
Initializes a new instance of the T:System.Collections.Generic.LinkedList`1 class that is serializabl...
Definition: LinkedList.cs:323
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
Describes a set of security permissions applied to code. This class cannot be inherited.
Provides a base class for implementations of the T:System.Collections.Generic.IEqualityComparer`1 gen...
Enumerator GetEnumerator()
Returns an enumerator that iterates through the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:639
bool MoveNext()
Advances the enumerator to the next element of the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:97
void Reset()
Sets the enumerator to its initial position, which is before the first element in the collection.
T Current
Gets the element at the current position of the enumerator.
Definition: LinkedList.cs:47
virtual void OnDeserialization(object sender)
Implements the T:System.Runtime.Serialization.ISerializable interface and raises the deserialization ...
Definition: LinkedList.cs:730
bool Remove(T value)
Removes the first occurrence of the specified value from the T:System.Collections....
Definition: LinkedList.cs:657
LinkedListNode< T > AddFirst(T value)
Adds a new node containing the specified value at the start of the T:System.Collections....
Definition: LinkedList.cs:418
Provides a mechanism for releasing unmanaged resources.To browse the .NET Framework source code for t...
Definition: IDisposable.cs:8
Indicates that a class is to be notified when deserialization of the entire object graph has been com...
LinkedListNode< T > First
Gets the first node of the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:231
Definition: __Canon.cs:3
new IEnumerator< T > GetEnumerator()
Returns an enumerator that iterates through the collection.
The exception that is thrown when the value of an argument is outside the allowable range of values a...
LinkedListNode< T > AddLast(T value)
Adds a new node containing the specified value at the end of the T:System.Collections....
Definition: LinkedList.cs:459
Exposes the enumerator, which supports a simple iteration over a collection of a specified type....
Definition: IEnumerable.cs:9
Represents a strongly-typed, read-only collection of elements.
LinkedList()
Initializes a new instance of the T:System.Collections.Generic.LinkedList`1 class that is empty.
Definition: LinkedList.cs:299
Describes the source and destination of a given serialized stream, and provides an additional caller-...
LinkedListNode< T > Next
Gets the next node in the T:System.Collections.Generic.LinkedList`1.
static EqualityComparer< T > Default
Returns a default equality comparer for the type specified by the generic argument.
Supports a simple iteration over a generic collection.
Definition: IEnumerator.cs:6
Defines methods to manipulate generic collections.
Definition: ICollection.cs:9
int Count
Gets the number of nodes actually contained in the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:219
LinkedListNode< T > Find(T value)
Finds the first node that contains the specified value.
Definition: LinkedList.cs:559
Represents a node in a T:System.Collections.Generic.LinkedList`1. This class cannot be inherited.
SecurityAction
Specifies the security actions that can be performed using declarative security.
bool Contains(T value)
Determines whether a value is in the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:515
void CopyTo(T[] array, int index)
Copies the entire T:System.Collections.Generic.LinkedList`1 to a compatible one-dimensional T:System....
Definition: LinkedList.cs:529
void OnDeserialization(object sender)
Runs when the entire object graph has been deserialized.
static int CompareExchange(ref int location1, int value, int comparand)
Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value.
void AddBefore(LinkedListNode< T > node, LinkedListNode< T > newNode)
Adds the specified new node before the specified existing node in the T:System.Collections....
Definition: LinkedList.cs:402
bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (threa...
Definition: ICollection.cs:33
void Remove(LinkedListNode< T > node)
Removes the specified node from the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:675
new T Current
Gets the element in the collection at the current position of the enumerator.
Definition: IEnumerator.cs:12
The exception thrown when an error occurs during serialization or deserialization.
void AddLast(LinkedListNode< T > node)
Adds the specified new node at the end of the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:480
void Dispose()
Releases all resources used by the T:System.Collections.Generic.LinkedList`1.Enumerator.
Definition: LinkedList.cs:134
LinkedListNode< T > AddBefore(LinkedListNode< T > node, T value)
Adds a new node containing the specified value before the specified existing node in the T:System....
Definition: LinkedList.cs:380
Stores all the data needed to serialize or deserialize an object. This class cannot be inherited.
Represents a doubly linked list.
Definition: LinkedList.cs:16
LinkedList(IEnumerable< T > collection)
Initializes a new instance of the T:System.Collections.Generic.LinkedList`1 class that contains eleme...
Definition: LinkedList.cs:308
The exception that is thrown when one of the arguments provided to a method is not valid.
void AddAfter(LinkedListNode< T > node, LinkedListNode< T > newNode)
Adds the specified new node after the specified existing node in the T:System.Collections....
Definition: LinkedList.cs:363
void RemoveFirst()
Removes the node at the start of the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:684
Allows an object to control its own serialization and deserialization.
Definition: ISerializable.cs:8
LinkedListNode< T > AddAfter(LinkedListNode< T > node, T value)
Adds a new node containing the specified value after the specified existing node in the T:System....
Definition: LinkedList.cs:345
Enumerates the elements of a T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:21
LinkedListNode< T > FindLast(T value)
Finds the last node that contains the specified value.
Definition: LinkedList.cs:597
object GetValue(string name, Type type)
Retrieves a value from the T:System.Runtime.Serialization.SerializationInfo store.
Specifies that the class can be serialized.
void AddFirst(LinkedListNode< T > node)
Adds the specified new node at the start of the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:440
The exception that is thrown when a method call is invalid for the object's current state.
int GetInt32(string name)
Retrieves a 32-bit signed integer value from the T:System.Runtime.Serialization.SerializationInfo sto...
SecurityPermissionFlag
Specifies access flags for the security permission object.
void GetObjectData(SerializationInfo info, StreamingContext context)
Populates a T:System.Runtime.Serialization.SerializationInfo with the data needed to serialize the ta...
Provides atomic operations for variables that are shared by multiple threads.
Definition: Interlocked.cs:10
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
Implements the T:System.Runtime.Serialization.ISerializable interface and returns the data needed to ...
Definition: LinkedList.cs:711
void RemoveLast()
Removes the node at the end of the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:696
void Clear()
Removes all nodes from the T:System.Collections.Generic.LinkedList`1.
Definition: LinkedList.cs:496