7 private const int CutoverPoint = 9;
9 private const int InitialHashtableSize = 13;
11 private const int FixedSizeCutoverPoint = 6;
17 private bool caseInsensitive;
24 public object this[
object key]
29 if (hashtable !=
null)
31 return hashtable[key];
33 if (listDictionary !=
null)
35 return listDictionary[key];
45 if (hashtable !=
null)
47 hashtable[key] = value;
49 else if (list !=
null)
54 hashtable[key] = value;
88 if (hashtable !=
null)
90 return hashtable.
Count;
92 return listDictionary?.
Count ?? 0;
102 if (hashtable !=
null)
104 return hashtable.
Keys;
132 if (hashtable !=
null)
148 : this(initialSize, caseInsensitive: false)
156 this.caseInsensitive = caseInsensitive;
164 this.caseInsensitive = caseInsensitive;
165 if (initialSize >= 6)
178 private void ChangeOver()
186 this.hashtable = hashtable;
196 public void Add(
object key,
object value)
198 if (hashtable !=
null)
200 hashtable.
Add(key, value);
202 else if (list ==
null)
205 list.Add(key, value);
207 else if (list.Count + 1 >= 9)
210 hashtable.
Add(key, value);
214 list.Add(key, value);
221 if (this.hashtable !=
null)
224 this.hashtable =
null;
231 listDictionary.
Clear();
244 if (hashtable !=
null)
248 if (listDictionary !=
null)
250 return listDictionary.
Contains(key);
271 if (hashtable !=
null)
273 hashtable.
CopyTo(array, index);
277 List.
CopyTo(array, index);
285 if (hashtable !=
null)
287 return hashtable.GetEnumerator();
293 return list.GetEnumerator();
300 if (hashtable !=
null)
302 return hashtable.GetEnumerator();
308 return list.GetEnumerator();
317 if (hashtable !=
null)
321 else if (list !=
null)
325 else if (key ==
null)
ICollection Values
Gets an T:System.Collections.ICollection containing the values in the T:System.Collections....
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
bool IsSynchronized
Gets a value indicating whether the T:System.Collections.Specialized.HybridDictionary is synchronized...
void CopyTo(Array array, int index)
Copies the T:System.Collections.Specialized.ListDictionary entries to a one-dimensional T:System....
virtual void Add(object key, object value)
Adds an element with the specified key and value into the T:System.Collections.Hashtable.
bool MoveNext()
Advances the enumerator to the next element of the collection.
void CopyTo(Array array, int index)
Copies the T:System.Collections.Specialized.HybridDictionary entries to a one-dimensional T:System....
HybridDictionary()
Creates an empty case-sensitive T:System.Collections.Specialized.HybridDictionary.
object Key
Gets the key of the current dictionary entry.
int Count
Gets the number of key/value pairs contained in the T:System.Collections.Specialized....
void Remove(object key)
Removes the entry with the specified key from the T:System.Collections.Specialized....
virtual ICollection Values
Gets an T:System.Collections.ICollection containing the values in the T:System.Collections....
Exposes an enumerator, which supports a simple iteration over a non-generic collection....
IDictionaryEnumerator GetEnumerator()
Returns an T:System.Collections.IDictionaryEnumerator that iterates through the T:System....
ICollection Keys
Gets an T:System.Collections.ICollection containing the keys in the T:System.Collections....
virtual void CopyTo(Array array, int arrayIndex)
Copies the T:System.Collections.Hashtable elements to a one-dimensional T:System.Array instance at th...
object SyncRoot
Gets an object that can be used to synchronize access to the T:System.Collections....
bool Contains(object key)
Determines whether the T:System.Collections.Specialized.ListDictionary contains a specific key.
Represents a collection of key/value pairs that are organized based on the hash code of the key....
virtual ICollection Keys
Gets an T:System.Collections.ICollection containing the keys in the T:System.Collections....
HybridDictionary(int initialSize, bool caseInsensitive)
Creates a T:System.Collections.Specialized.HybridDictionary with the specified initial size and case ...
bool Contains(object key)
Determines whether the T:System.Collections.Specialized.HybridDictionary contains a specific key.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
bool IsFixedSize
Gets a value indicating whether the T:System.Collections.Specialized.HybridDictionary has a fixed siz...
int??? Count
Gets the number of key/value pairs contained in the T:System.Collections.Specialized....
HybridDictionary(int initialSize)
Creates a case-sensitive T:System.Collections.Specialized.HybridDictionary with the specified initial...
IEnumerator GetEnumerator()
Returns an enumerator that iterates through a collection.
void Clear()
Removes all entries from the T:System.Collections.Specialized.HybridDictionary.
bool IsReadOnly
Gets a value indicating whether the T:System.Collections.Specialized.HybridDictionary is read-only.
ICollection Keys
Gets an T:System.Collections.ICollection containing the keys in the T:System.Collections....
void Add(object key, object value)
Adds an entry with the specified key and value into the T:System.Collections.Specialized....
virtual bool Contains(object key)
Determines whether the T:System.Collections.Hashtable contains a specific key.
Implements IDictionary by using a T:System.Collections.Specialized.ListDictionary while the collectio...
void Clear()
Removes all entries from the T:System.Collections.Specialized.ListDictionary.
virtual void Remove(object key)
Removes the element with the specified key from the T:System.Collections.Hashtable.
object Value
Gets the value of the current dictionary entry.
Specifies that the class can be serialized.
Enumerates the elements of a nongeneric dictionary.
static StringComparer OrdinalIgnoreCase
Gets a T:System.StringComparer object that performs a case-insensitive ordinal string comparison.
HybridDictionary(bool caseInsensitive)
Creates an empty T:System.Collections.Specialized.HybridDictionary with the specified case sensitivit...
virtual void Clear()
Removes all elements from the T:System.Collections.Hashtable.
Defines size, enumerators, and synchronization methods for all nongeneric collections.
Represents a nongeneric collection of key/value pairs.
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....
virtual int Count
Gets the number of key/value pairs contained in the T:System.Collections.Hashtable.
Implements IDictionary using a singly linked list. Recommended for collections that typically include...
Represents a string comparison operation that uses specific case and culture-based or ordinal compari...