11[DebuggerDisplay(
"Count = {Count}")]
12[
TypeForwardedFrom(
"mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
13public class Dictionary<TKey, TValue> :
IDictionary<TKey, TValue>,
ICollection<KeyValuePair<TKey, TValue>>,
IEnumerable<KeyValuePair<TKey, TValue>>,
IEnumerable,
IDictionary,
ICollection,
IReadOnlyDictionary<TKey, TValue>,
IReadOnlyCollection<KeyValuePair<TKey, TValue>>,
ISerializable,
IDeserializationCallback where TKey :
notnull
29 uint num = (uint)(
comparer?.GetHashCode(
key) ??
key.GetHashCode());
32 int num3 = bucket - 1;
35 if (
typeof(TKey).IsValueType)
247 [DebuggerDisplay(
"Count = {Count}")]
357 for (
int i = 0; i <
count; i++)
407 if (
array.GetLowerBound(0) != 0)
433 for (
int i = 0; i <
count; i++)
449 [DebuggerDisplay(
"Count = {Count}")]
559 for (
int i = 0; i <
count; i++)
609 if (
array.GetLowerBound(0) != 0)
635 for (
int i = 0; i <
count; i++)
696 public TValue
this[TKey
key]
706 return default(TValue);
853 for (
int i = 0; i <
count; i++)
927 for (
int i = 0; i <
_count; i++)
935 else if (
typeof(TValue).IsValueType)
975 for (
int i = 0; i <
count; i++)
1027 if (
typeof(TKey).IsValueType)
1030 while ((uint)bucket < (uint)
entries.Length)
1037 if (num <= (uint)
entries.Length)
1050 while ((uint)bucket < (uint)
entries.Length)
1057 if (num <= (uint)
entries.Length)
1102 int[] buckets =
new int[
prime];
1123 uint num = (uint)(
comparer?.GetHashCode(
key) ??
key.GetHashCode());
1126 int num3 = bucket - 1;
1129 if (
typeof(TKey).IsValueType)
1246 int @
int =
value.GetInt32(
"Version");
1257 for (
int i = 0; i <
array.Length; i++)
1259 if (
array[i].Key ==
null)
1287 for (
int i = 0; i <
count; i++)
1289 if (
array[i].next >= -1)
1306 array[
j].next = bucket - 1;
1326 int num4 = bucket - 1;
1356 if (num > (uint)
entries.Length)
1378 int num4 = bucket - 1;
1409 if (num > (uint)
entries.Length)
1415 value =
default(TValue);
1427 value =
default(TValue);
1447 if (
array.Rank != 1)
1451 if (
array.GetLowerBound(0) != 0)
1471 for (
int i = 0; i <
_count; i++)
1556 for (
int i = 0; i <
count; i++)
1558 uint hashCode =
entries[i].hashCode;
static unsafe void Clear(Array array)
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
static ref TValue GetValueRefOrAddDefault(Dictionary< TKey, TValue > dictionary, TKey key, out bool exists)
KeyCollection(Dictionary< TKey, TValue > dictionary)
readonly Dictionary< TKey, TValue > _dictionary
Enumerator GetEnumerator()
void CopyTo(TKey[] array, int index)
ValueCollection(Dictionary< TKey, TValue > dictionary)
Enumerator GetEnumerator()
void CopyTo(TValue[] array, int index)
readonly Dictionary< TKey, TValue > _dictionary
ICollection< TValue > IDictionary< TKey, TValue >. Values
int EnsureCapacity(int capacity)
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
ICollection IDictionary. Keys
Dictionary(IEnumerable< KeyValuePair< TKey, TValue > > collection, IEqualityComparer< TKey >? comparer)
IEqualityComparer< TKey > _comparer
void CopyEntries(Entry[] entries, int count)
bool ContainsKey(TKey key)
IEnumerable< TKey > IReadOnlyDictionary< TKey, TValue >. Keys
virtual void OnDeserialization(object? sender)
bool ContainsValue(TValue value)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
Dictionary(int capacity, IEqualityComparer< TKey >? comparer)
Dictionary(IEqualityComparer< TKey >? comparer)
bool TryInsert(TKey key, TValue value, InsertionBehavior behavior)
ICollection IDictionary. Values
int Initialize(int capacity)
Dictionary(IEnumerable< KeyValuePair< TKey, TValue > > collection)
static bool IsCompatibleKey(object key)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
bool Remove(TKey key, [MaybeNullWhen(false)] out TValue value)
Dictionary(SerializationInfo info, StreamingContext context)
void Resize(int newSize, bool forceNewHashCodes)
IEnumerable< TValue > IReadOnlyDictionary< TKey, TValue >. Values
ICollection< TKey > IDictionary< TKey, TValue >. Keys
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
bool ICollection< KeyValuePair< TKey, TValue > >. IsReadOnly
bool TryAdd(TKey key, TValue value)
ref TValue FindValue(TKey key)
ref int GetBucket(uint hashCode)
Enumerator GetEnumerator()
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
void TrimExcess(int capacity)
Dictionary(IDictionary< TKey, TValue > dictionary)
Dictionary(IDictionary< TKey, TValue > dictionary, IEqualityComparer< TKey >? comparer)
void Add(TKey key, TValue value)
static ? IEqualityComparer< string > GetStringComparer(object? comparer)
static int GetPrime(int min)
static uint FastMod(uint value, uint divisor, ulong multiplier)
static int ExpandPrime(int oldSize)
static ulong GetFastModMultiplier(uint divisor)
static ConditionalWeakTable< object, SerializationInfo > SerializationInfoTable
static void ThrowNotSupportedException(ExceptionResource resource)
static void ThrowInvalidOperationException_InvalidOperation_EnumOpCantHappen()
static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument)
static void ThrowArgumentException_Argument_InvalidArrayType()
static void ThrowArgumentNullException(string name)
static void ThrowSerializationException(ExceptionResource resource)
static void ThrowArgumentException(ExceptionResource resource)
static void ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion()
static void ThrowIndexArgumentOutOfRange_NeedNonNegNumException()
static void ThrowInvalidOperationException_ConcurrentOperationsNotSupported()
void CopyTo(T[] array, int arrayIndex)
void Add(TKey key, TValue value)
new IEnumerator< T > GetEnumerator()
IEqualityComparer< string > GetUnderlyingEqualityComparer()
new bool Equals(object? x, object? y)
int GetHashCode(object obj)
readonly int _getEnumeratorRetType
readonly Dictionary< TKey, TValue > _dictionary
KeyValuePair< TKey, TValue > Current
Enumerator(Dictionary< TKey, TValue > dictionary, int getEnumeratorRetType)
KeyValuePair< TKey, TValue > _current
Enumerator(Dictionary< TKey, TValue > dictionary)
readonly Dictionary< TKey, TValue > _dictionary
readonly Dictionary< TKey, TValue > _dictionary
Enumerator(Dictionary< TKey, TValue > dictionary)