13 private DictionaryNode current;
19 public object Current => Entry;
60 version = list.version;
65 public bool MoveNext()
67 if (version != list.version)
76 else if (current !=
null)
78 current = current.next;
80 return current !=
null;
85 if (version != list.version)
100 private DictionaryNode current;
108 public object Current
118 return current.value;
127 this.isKeys = isKeys;
128 version = list.version;
133 public bool MoveNext()
135 if (version != list.version)
144 else if (current !=
null)
146 current = current.next;
148 return current !=
null;
153 if (version != list.version)
171 for (DictionaryNode dictionaryNode = list.head; dictionaryNode !=
null; dictionaryNode = dictionaryNode.next)
191 return list.SyncRoot;
198 this.isKeys = isKeys;
211 for (DictionaryNode dictionaryNode = list.head; dictionaryNode !=
null; dictionaryNode = dictionaryNode.next)
213 array.SetValue(isKeys ? dictionaryNode.key : dictionaryNode.value, index);
220 return new NodeKeyValueEnumerator(list, isKeys);
225 private class DictionaryNode
231 public DictionaryNode next;
234 private DictionaryNode head;
243 private object _syncRoot;
250 public object this[
object key]
258 DictionaryNode next = head;
259 if (comparer ==
null)
263 object key2 = next.key;
264 if (key2 !=
null && key2.Equals(key))
275 object key3 = next.key;
276 if (key3 !=
null && comparer.
Compare(key3, key) == 0)
292 DictionaryNode dictionaryNode =
null;
294 for (next = head; next !=
null; next = next.next)
296 object key2 = next.key;
297 if ((comparer ==
null) ? key2.Equals(key) : (comparer.
Compare(key2, key) == 0))
301 dictionaryNode = next;
308 DictionaryNode dictionaryNode2 =
new DictionaryNode();
309 dictionaryNode2.key = key;
310 dictionaryNode2.value = value;
311 if (dictionaryNode !=
null)
313 dictionaryNode.next = dictionaryNode2;
317 head = dictionaryNode2;
349 if (_syncRoot ==
null)
371 this.comparer = comparer;
380 public void Add(
object key,
object value)
387 DictionaryNode dictionaryNode =
null;
388 for (DictionaryNode next = head; next !=
null; next = next.next)
390 object key2 = next.key;
391 if ((comparer ==
null) ? key2.Equals(key) : (comparer.
Compare(key2, key) == 0))
395 dictionaryNode = next;
397 DictionaryNode dictionaryNode2 =
new DictionaryNode();
398 dictionaryNode2.key = key;
399 dictionaryNode2.value = value;
400 if (dictionaryNode !=
null)
402 dictionaryNode.next = dictionaryNode2;
406 head = dictionaryNode2;
431 for (DictionaryNode next = head; next !=
null; next = next.next)
433 object key2 = next.key;
434 if ((comparer ==
null) ? key2.Equals(key) : (comparer.
Compare(key2, key) == 0))
462 if (array.Length - index < count)
466 for (DictionaryNode next = head; next !=
null; next = next.next)
477 return new NodeEnumerator(
this);
484 return new NodeEnumerator(
this);
498 DictionaryNode dictionaryNode =
null;
500 for (next = head; next !=
null; next = next.next)
502 object key2 = next.key;
503 if ((comparer ==
null) ? key2.Equals(key) : (comparer.
Compare(key2, key) == 0))
507 dictionaryNode = next;
517 dictionaryNode.next = next.next;
object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
void CopyTo(Array array, int index)
Copies the T:System.Collections.Specialized.ListDictionary entries to a one-dimensional T:System....
object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
The content of the collection was cleared.
void Add(object key, object value)
Adds an entry with the specified key and value into the T:System.Collections.Specialized....
The exception that is thrown when the value of an argument is outside the allowable range of values a...
bool IsSynchronized
Gets a value indicating whether the T:System.Collections.Specialized.ListDictionary is synchronized (...
ListDictionary(IComparer comparer)
Creates an empty T:System.Collections.Specialized.ListDictionary using the specified comparer.
int Count
Gets the number of key/value pairs contained in the T:System.Collections.Specialized....
int Compare(object x, object y)
Compares two objects and returns a value indicating whether one is less than, equal to,...
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
ICollection Keys
Gets an T:System.Collections.ICollection containing the keys in the T:System.Collections....
void Remove(object key)
Removes the entry with the specified key from the T:System.Collections.Specialized....
bool Contains(object key)
Determines whether the T:System.Collections.Specialized.ListDictionary contains a specific key.
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.
Exposes a method that compares two objects.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
bool IsSynchronized
Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (threa...
IEnumerator GetEnumerator()
Returns an enumerator that iterates through a collection.
The exception that is thrown when one of the arguments provided to a method is not valid.
bool IsFixedSize
Gets a value indicating whether the T:System.Collections.Specialized.ListDictionary has a fixed size.
void Clear()
Removes all entries from the T:System.Collections.Specialized.ListDictionary.
Specifies that the class can be serialized.
Enumerates the elements of a nongeneric dictionary.
The exception that is thrown when a method call is invalid for the object's current state.
int Count
Gets the number of elements contained in the T:System.Collections.ICollection.
bool IsReadOnly
Gets a value indicating whether the T:System.Collections.Specialized.ListDictionary is read-only.
Defines size, enumerators, and synchronization methods for all nongeneric collections.
void CopyTo(Array array, int index)
Copies the elements of the T:System.Collections.ICollection to an T:System.Array, starting at a parti...
Defines a dictionary key/value pair that can be set or retrieved.
Represents a nongeneric collection of key/value pairs.
Provides atomic operations for variables that are shared by multiple threads.
ListDictionary()
Creates an empty T:System.Collections.Specialized.ListDictionary using the default comparer.
Supports a simple iteration over a non-generic collection.
ICollection Values
Gets an T:System.Collections.ICollection containing the values in the T:System.Collections....
Implements IDictionary using a singly linked list. Recommended for collections that typically include...
IDictionaryEnumerator GetEnumerator()
Returns an T:System.Collections.IDictionaryEnumerator that iterates through the T:System....