Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
Hashtable.cs
Go to the documentation of this file.
5
6namespace System.Collections;
7
9[DebuggerTypeProxy(typeof(HashtableDebugView))]
10[DebuggerDisplay("Count = {Count}")]
11[TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")]
13{
14 private struct bucket
15 {
16 public object key;
17
18 public object val;
19
20 public int hash_coll;
21 }
22
23 private sealed class KeyCollection : ICollection, IEnumerable
24 {
25 private readonly Hashtable _hashtable;
26
28
29 public object SyncRoot => _hashtable.SyncRoot;
30
31 public int Count => _hashtable._count;
32
33 internal KeyCollection(Hashtable hashtable)
34 {
35 _hashtable = hashtable;
36 }
37
38 public void CopyTo(Array array, int arrayIndex)
39 {
40 if (array == null)
41 {
42 throw new ArgumentNullException("array");
43 }
44 if (array.Rank != 1)
45 {
47 }
48 if (arrayIndex < 0)
49 {
51 }
52 if (array.Length - arrayIndex < _hashtable._count)
53 {
55 }
57 }
58
60 {
61 return new HashtableEnumerator(_hashtable, 1);
62 }
63 }
64
65 private sealed class ValueCollection : ICollection, IEnumerable
66 {
67 private readonly Hashtable _hashtable;
68
70
71 public object SyncRoot => _hashtable.SyncRoot;
72
73 public int Count => _hashtable._count;
74
75 internal ValueCollection(Hashtable hashtable)
76 {
77 _hashtable = hashtable;
78 }
79
80 public void CopyTo(Array array, int arrayIndex)
81 {
82 if (array == null)
83 {
84 throw new ArgumentNullException("array");
85 }
86 if (array.Rank != 1)
87 {
89 }
90 if (arrayIndex < 0)
91 {
93 }
94 if (array.Length - arrayIndex < _hashtable._count)
95 {
97 }
99 }
100
102 {
103 return new HashtableEnumerator(_hashtable, 2);
104 }
105 }
106
107 private sealed class SyncHashtable : Hashtable, IEnumerable
108 {
110
111 public override int Count => _table.Count;
112
113 public override bool IsReadOnly => _table.IsReadOnly;
114
115 public override bool IsFixedSize => _table.IsFixedSize;
116
117 public override bool IsSynchronized => true;
118
119 public override object this[object key]
120 {
121 get
122 {
123 return _table[key];
124 }
125 set
126 {
128 {
129 _table[key] = value;
130 }
131 }
132 }
133
134 public override object SyncRoot => _table.SyncRoot;
135
136 public override ICollection Keys
137 {
138 get
139 {
141 {
142 return _table.Keys;
143 }
144 }
145 }
146
147 public override ICollection Values
148 {
149 get
150 {
152 {
153 return _table.Values;
154 }
155 }
156 }
157
158 internal SyncHashtable(Hashtable table)
159 : base(trash: false)
160 {
161 _table = table;
162 }
163
165 : base(info, context)
166 {
168 }
169
171 {
173 }
174
175 public override void Add(object key, object value)
176 {
178 {
180 }
181 }
182
183 public override void Clear()
184 {
186 {
187 _table.Clear();
188 }
189 }
190
191 public override bool Contains(object key)
192 {
193 return _table.Contains(key);
194 }
195
196 public override bool ContainsKey(object key)
197 {
198 if (key == null)
199 {
200 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
201 }
202 return _table.ContainsKey(key);
203 }
204
205 public override bool ContainsValue(object key)
206 {
208 {
209 return _table.ContainsValue(key);
210 }
211 }
212
213 public override void CopyTo(Array array, int arrayIndex)
214 {
216 {
218 }
219 }
220
221 public override object Clone()
222 {
224 {
226 }
227 }
228
233
235 {
236 return _table.GetEnumerator();
237 }
238
239 public override void Remove(object key)
240 {
242 {
244 }
245 }
246
247 public override void OnDeserialization(object sender)
248 {
249 }
250
252 {
254 }
255 }
256
258 {
259 private readonly Hashtable _hashtable;
260
261 private int _bucket;
262
263 private readonly int _version;
264
265 private bool _current;
266
267 private readonly int _getObjectRetType;
268
269 private object _currentKey;
270
271 private object _currentValue;
272
273 public object Key
274 {
275 get
276 {
277 if (!_current)
278 {
280 }
281 return _currentKey;
282 }
283 }
284
286 {
287 get
288 {
289 if (!_current)
290 {
292 }
294 }
295 }
296
297 public object Current
298 {
299 get
300 {
301 if (!_current)
302 {
304 }
305 if (_getObjectRetType == 1)
306 {
307 return _currentKey;
308 }
309 if (_getObjectRetType == 2)
310 {
311 return _currentValue;
312 }
314 }
315 }
316
317 public object Value
318 {
319 get
320 {
321 if (!_current)
322 {
324 }
325 return _currentValue;
326 }
327 }
328
330 {
331 _hashtable = hashtable;
332 _bucket = hashtable._buckets.Length;
333 _version = hashtable._version;
334 _current = false;
336 }
337
338 public object Clone()
339 {
340 return MemberwiseClone();
341 }
342
343 public bool MoveNext()
344 {
346 {
348 }
349 while (_bucket > 0)
350 {
351 _bucket--;
353 if (key != null && key != _hashtable._buckets)
354 {
357 _current = true;
358 return true;
359 }
360 }
361 _current = false;
362 return false;
363 }
364
365 public void Reset()
366 {
368 {
370 }
371 _current = false;
372 _bucket = _hashtable._buckets.Length;
373 _currentKey = null;
374 _currentValue = null;
375 }
376 }
377
378 internal sealed class HashtableDebugView
379 {
380 private readonly Hashtable _hashtable;
381
384
386 {
387 if (hashtable == null)
388 {
389 throw new ArgumentNullException("hashtable");
390 }
391 _hashtable = hashtable;
392 }
393 }
394
395 private bucket[] _buckets;
396
397 private int _count;
398
399 private int _occupancy;
400
401 private int _loadsize;
402
403 private float _loadFactor;
404
405 private volatile int _version;
406
407 private volatile bool _isWriterInProgress;
408
410
412
414
415 [Obsolete("Hashtable.hcp has been deprecated. Use the EqualityComparer property instead.")]
417 {
418 get
419 {
421 {
422 return ((CompatibleComparer)_keycomparer).HashCodeProvider;
423 }
424 if (_keycomparer == null)
425 {
426 return null;
427 }
429 }
430 set
431 {
433 {
435 return;
436 }
437 if (_keycomparer == null)
438 {
440 return;
441 }
443 }
444 }
445
446 [Obsolete("Hashtable.comparer has been deprecated. Use the KeyComparer properties instead.")]
448 {
449 get
450 {
452 {
453 return ((CompatibleComparer)_keycomparer).Comparer;
454 }
455 if (_keycomparer == null)
456 {
457 return null;
458 }
460 }
461 set
462 {
464 {
466 return;
467 }
468 if (_keycomparer == null)
469 {
471 return;
472 }
474 }
475 }
476
478
479 public virtual object? this[object key]
480 {
481 get
482 {
483 if (key == null)
484 {
485 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
486 }
487 bucket[] buckets = _buckets;
488 uint seed;
489 uint incr;
490 uint num = InitHash(key, buckets.Length, out seed, out incr);
491 int num2 = 0;
492 int num3 = (int)(seed % (uint)buckets.Length);
494 do
495 {
496 SpinWait spinWait = default(SpinWait);
497 while (true)
498 {
499 int version = _version;
500 bucket = buckets[num3];
501 if (!_isWriterInProgress && version == _version)
502 {
503 break;
504 }
505 spinWait.SpinOnce();
506 }
507 if (bucket.key == null)
508 {
509 return null;
510 }
511 if ((bucket.hash_coll & 0x7FFFFFFF) == num && KeyEquals(bucket.key, key))
512 {
513 return bucket.val;
514 }
515 num3 = (int)((num3 + incr) % (uint)buckets.Length);
516 }
517 while (bucket.hash_coll < 0 && ++num2 < buckets.Length);
518 return null;
519 }
520 set
521 {
522 Insert(key, value, add: false);
523 }
524 }
525
526 public virtual bool IsReadOnly => false;
527
528 public virtual bool IsFixedSize => false;
529
530 public virtual bool IsSynchronized => false;
531
532 public virtual ICollection Keys => _keys ?? (_keys = new KeyCollection(this));
533
534 public virtual ICollection Values => _values ?? (_values = new ValueCollection(this));
535
536 public virtual object SyncRoot => this;
537
538 public virtual int Count => _count;
539
540 internal Hashtable(bool trash)
541 {
542 }
543
544 public Hashtable()
545 : this(0, 1f)
546 {
547 }
548
549 public Hashtable(int capacity)
550 : this(capacity, 1f)
551 {
552 }
553
554 public Hashtable(int capacity, float loadFactor)
555 {
556 if (capacity < 0)
557 {
559 }
560 if (!(loadFactor >= 0.1f) || !(loadFactor <= 1f))
561 {
563 }
564 _loadFactor = 0.72f * loadFactor;
565 double num = (float)capacity / _loadFactor;
566 if (num > 2147483647.0)
567 {
568 throw new ArgumentException(SR.Arg_HTCapacityOverflow, "capacity");
569 }
570 int num2 = ((num > 3.0) ? HashHelpers.GetPrime((int)num) : 3);
571 _buckets = new bucket[num2];
572 _loadsize = (int)(_loadFactor * (float)num2);
573 _isWriterInProgress = false;
574 }
575
581
582 [Obsolete("This constructor has been deprecated. Use Hashtable(IEqualityComparer) instead.")]
584 : this(0, 1f, hcp, comparer)
585 {
586 }
587
592
593 [Obsolete("This constructor has been deprecated. Use Hashtable(int, IEqualityComparer) instead.")]
598
603
605 : this(d, 1f)
606 {
607 }
608
610 : this(d, loadFactor, null)
611 {
612 }
613
614 [Obsolete("This constructor has been deprecated. Use Hashtable(IDictionary, IEqualityComparer) instead.")]
619
624
625 [Obsolete("This constructor has been deprecated. Use Hashtable(int, float, IEqualityComparer) instead.")]
628 {
629 if (hcp != null || comparer != null)
630 {
632 }
633 }
634
635 [Obsolete("This constructor has been deprecated. Use Hashtable(IDictionary, float, IEqualityComparer) instead.")]
637 : this(d?.Count ?? 0, loadFactor, hcp, comparer)
638 {
639 if (d == null)
640 {
642 }
643 IDictionaryEnumerator enumerator = d.GetEnumerator();
644 while (enumerator.MoveNext())
645 {
646 Add(enumerator.Key, enumerator.Value);
647 }
648 }
649
652 {
653 if (d == null)
654 {
656 }
657 IDictionaryEnumerator enumerator = d.GetEnumerator();
658 while (enumerator.MoveNext())
659 {
660 Add(enumerator.Key, enumerator.Value);
661 }
662 }
663
668
669 private uint InitHash(object key, int hashsize, out uint seed, out uint incr)
670 {
671 uint result = (seed = (uint)GetHash(key) & 0x7FFFFFFFu);
672 incr = 1 + seed * 101 % (uint)(hashsize - 1);
673 return result;
674 }
675
676 public virtual void Add(object key, object? value)
677 {
678 Insert(key, value, add: true);
679 }
680
681 public virtual void Clear()
682 {
683 if (_count != 0 || _occupancy != 0)
684 {
685 _isWriterInProgress = true;
686 for (int i = 0; i < _buckets.Length; i++)
687 {
688 _buckets[i].hash_coll = 0;
689 _buckets[i].key = null;
690 _buckets[i].val = null;
691 }
692 _count = 0;
693 _occupancy = 0;
695 _isWriterInProgress = false;
696 }
697 }
698
699 public virtual object Clone()
700 {
701 bucket[] buckets = _buckets;
702 Hashtable hashtable = new Hashtable(_count, _keycomparer);
706 int num = buckets.Length;
707 while (num > 0)
708 {
709 num--;
710 object key = buckets[num].key;
711 if (key != null && key != buckets)
712 {
713 hashtable[key] = buckets[num].val;
714 }
715 }
716 return hashtable;
717 }
718
719 public virtual bool Contains(object key)
720 {
721 return ContainsKey(key);
722 }
723
724 public virtual bool ContainsKey(object key)
725 {
726 if (key == null)
727 {
728 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
729 }
730 bucket[] buckets = _buckets;
731 uint seed;
732 uint incr;
733 uint num = InitHash(key, buckets.Length, out seed, out incr);
734 int num2 = 0;
735 int num3 = (int)(seed % (uint)buckets.Length);
737 do
738 {
739 bucket = buckets[num3];
740 if (bucket.key == null)
741 {
742 return false;
743 }
744 if ((bucket.hash_coll & 0x7FFFFFFF) == num && KeyEquals(bucket.key, key))
745 {
746 return true;
747 }
748 num3 = (int)((num3 + incr) % (uint)buckets.Length);
749 }
750 while (bucket.hash_coll < 0 && ++num2 < buckets.Length);
751 return false;
752 }
753
754 public virtual bool ContainsValue(object? value)
755 {
756 if (value == null)
757 {
758 int num = _buckets.Length;
759 while (--num >= 0)
760 {
761 if (_buckets[num].key != null && _buckets[num].key != _buckets && _buckets[num].val == null)
762 {
763 return true;
764 }
765 }
766 }
767 else
768 {
769 int num2 = _buckets.Length;
770 while (--num2 >= 0)
771 {
772 object val = _buckets[num2].val;
773 if (val != null && val.Equals(value))
774 {
775 return true;
776 }
777 }
778 }
779 return false;
780 }
781
782 private void CopyKeys(Array array, int arrayIndex)
783 {
784 bucket[] buckets = _buckets;
785 int num = buckets.Length;
786 while (--num >= 0)
787 {
788 object key = buckets[num].key;
789 if (key != null && key != _buckets)
790 {
791 array.SetValue(key, arrayIndex++);
792 }
793 }
794 }
795
797 {
798 bucket[] buckets = _buckets;
799 int num = buckets.Length;
800 while (--num >= 0)
801 {
802 object key = buckets[num].key;
803 if (key != null && key != _buckets)
804 {
805 DictionaryEntry dictionaryEntry = new DictionaryEntry(key, buckets[num].val);
806 array.SetValue(dictionaryEntry, arrayIndex++);
807 }
808 }
809 }
810
811 public virtual void CopyTo(Array array, int arrayIndex)
812 {
813 if (array == null)
814 {
815 throw new ArgumentNullException("array", SR.ArgumentNull_Array);
816 }
817 if (array.Rank != 1)
818 {
820 }
821 if (arrayIndex < 0)
822 {
824 }
825 if (array.Length - arrayIndex < Count)
826 {
828 }
830 }
831
833 {
835 int num = 0;
836 bucket[] buckets = _buckets;
837 int num2 = buckets.Length;
838 while (--num2 >= 0)
839 {
840 object key = buckets[num2].key;
841 if (key != null && key != _buckets)
842 {
843 array[num++] = new KeyValuePairs(key, buckets[num2].val);
844 }
845 }
846 return array;
847 }
848
849 private void CopyValues(Array array, int arrayIndex)
850 {
851 bucket[] buckets = _buckets;
852 int num = buckets.Length;
853 while (--num >= 0)
854 {
855 object key = buckets[num].key;
856 if (key != null && key != _buckets)
857 {
858 array.SetValue(buckets[num].val, arrayIndex++);
859 }
860 }
861 }
862
863 private void expand()
864 {
867 }
868
869 private void rehash()
870 {
871 rehash(_buckets.Length);
872 }
873
874 private void UpdateVersion()
875 {
876 _version++;
877 }
878
879 private void rehash(int newsize)
880 {
881 _occupancy = 0;
882 bucket[] array = new bucket[newsize];
883 for (int i = 0; i < _buckets.Length; i++)
884 {
886 if (bucket.key != null && bucket.key != _buckets)
887 {
888 int hashcode = bucket.hash_coll & 0x7FFFFFFF;
890 }
891 }
892 _isWriterInProgress = true;
893 _buckets = array;
894 _loadsize = (int)(_loadFactor * (float)newsize);
896 _isWriterInProgress = false;
897 }
898
900 {
901 return new HashtableEnumerator(this, 3);
902 }
903
905 {
906 return new HashtableEnumerator(this, 3);
907 }
908
909 protected virtual int GetHash(object key)
910 {
911 if (_keycomparer != null)
912 {
914 }
915 return key.GetHashCode();
916 }
917
918 protected virtual bool KeyEquals(object? item, object key)
919 {
920 if (_buckets == item)
921 {
922 return false;
923 }
924 if (item == key)
925 {
926 return true;
927 }
928 if (_keycomparer != null)
929 {
930 return _keycomparer.Equals(item, key);
931 }
932 return item?.Equals(key) ?? false;
933 }
934
935 private void Insert(object key, object nvalue, bool add)
936 {
937 if (key == null)
938 {
939 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
940 }
941 if (_count >= _loadsize)
942 {
943 expand();
944 }
945 else if (_occupancy > _loadsize && _count > 100)
946 {
947 rehash();
948 }
949 uint seed;
950 uint incr;
951 uint num = InitHash(key, _buckets.Length, out seed, out incr);
952 int num2 = 0;
953 int num3 = -1;
954 int num4 = (int)(seed % (uint)_buckets.Length);
955 do
956 {
957 if (num3 == -1 && _buckets[num4].key == _buckets && _buckets[num4].hash_coll < 0)
958 {
959 num3 = num4;
960 }
961 if (_buckets[num4].key == null || (_buckets[num4].key == _buckets && (_buckets[num4].hash_coll & 0x80000000u) == 0L))
962 {
963 if (num3 != -1)
964 {
965 num4 = num3;
966 }
967 _isWriterInProgress = true;
969 _buckets[num4].key = key;
970 _buckets[num4].hash_coll |= (int)num;
971 _count++;
973 _isWriterInProgress = false;
974 return;
975 }
976 if ((_buckets[num4].hash_coll & 0x7FFFFFFF) == num && KeyEquals(_buckets[num4].key, key))
977 {
978 if (add)
979 {
981 }
982 _isWriterInProgress = true;
985 _isWriterInProgress = false;
986 return;
987 }
988 if (num3 == -1 && _buckets[num4].hash_coll >= 0)
989 {
990 _buckets[num4].hash_coll |= int.MinValue;
991 _occupancy++;
992 }
993 num4 = (int)((num4 + incr) % (uint)_buckets.Length);
994 }
995 while (++num2 < _buckets.Length);
996 if (num3 != -1)
997 {
998 _isWriterInProgress = true;
1000 _buckets[num3].key = key;
1001 _buckets[num3].hash_coll |= (int)num;
1002 _count++;
1003 UpdateVersion();
1004 _isWriterInProgress = false;
1005 return;
1006 }
1008 }
1009
1010 private void putEntry(bucket[] newBuckets, object key, object nvalue, int hashcode)
1011 {
1012 uint num = 1 + (uint)(hashcode * 101) % (uint)(newBuckets.Length - 1);
1013 int num2 = (int)((uint)hashcode % (uint)newBuckets.Length);
1014 while (newBuckets[num2].key != null && newBuckets[num2].key != _buckets)
1015 {
1016 if (newBuckets[num2].hash_coll >= 0)
1017 {
1018 newBuckets[num2].hash_coll |= int.MinValue;
1019 _occupancy++;
1020 }
1021 num2 = (int)((num2 + num) % (uint)newBuckets.Length);
1022 }
1023 newBuckets[num2].val = nvalue;
1024 newBuckets[num2].key = key;
1025 newBuckets[num2].hash_coll |= hashcode;
1026 }
1027
1028 public virtual void Remove(object key)
1029 {
1030 if (key == null)
1031 {
1032 throw new ArgumentNullException("key", SR.ArgumentNull_Key);
1033 }
1034 uint seed;
1035 uint incr;
1036 uint num = InitHash(key, _buckets.Length, out seed, out incr);
1037 int num2 = 0;
1038 int num3 = (int)(seed % (uint)_buckets.Length);
1039 bucket bucket;
1040 do
1041 {
1042 bucket = _buckets[num3];
1043 if ((bucket.hash_coll & 0x7FFFFFFF) == num && KeyEquals(bucket.key, key))
1044 {
1045 _isWriterInProgress = true;
1046 _buckets[num3].hash_coll &= int.MinValue;
1047 if (_buckets[num3].hash_coll != 0)
1048 {
1050 }
1051 else
1052 {
1053 _buckets[num3].key = null;
1054 }
1055 _buckets[num3].val = null;
1056 _count--;
1057 UpdateVersion();
1058 _isWriterInProgress = false;
1059 break;
1060 }
1061 num3 = (int)((num3 + incr) % (uint)_buckets.Length);
1062 }
1063 while (bucket.hash_coll < 0 && ++num2 < _buckets.Length);
1064 }
1065
1066 public static Hashtable Synchronized(Hashtable table)
1067 {
1068 if (table == null)
1069 {
1070 throw new ArgumentNullException("table");
1071 }
1072 return new SyncHashtable(table);
1073 }
1074
1076 {
1077 if (info == null)
1078 {
1079 throw new ArgumentNullException("info");
1080 }
1081 lock (SyncRoot)
1082 {
1083 int version = _version;
1084 info.AddValue("LoadFactor", _loadFactor);
1085 info.AddValue("Version", _version);
1087 if (keycomparer == null)
1088 {
1089 info.AddValue("Comparer", null, typeof(IComparer));
1090 info.AddValue("HashCodeProvider", null, typeof(IHashCodeProvider));
1091 }
1093 {
1095 info.AddValue("Comparer", compatibleComparer.Comparer, typeof(IComparer));
1096 info.AddValue("HashCodeProvider", compatibleComparer.HashCodeProvider, typeof(IHashCodeProvider));
1097 }
1098 else
1099 {
1100 info.AddValue("KeyComparer", keycomparer, typeof(IEqualityComparer));
1101 }
1102 info.AddValue("HashSize", _buckets.Length);
1103 object[] array = new object[_count];
1104 object[] array2 = new object[_count];
1105 CopyKeys(array, 0);
1106 CopyValues(array2, 0);
1107 info.AddValue("Keys", array, typeof(object[]));
1108 info.AddValue("Values", array2, typeof(object[]));
1109 if (_version != version)
1110 {
1112 }
1113 }
1114 }
1115
1116 public virtual void OnDeserialization(object? sender)
1117 {
1118 if (_buckets != null)
1119 {
1120 return;
1121 }
1122 HashHelpers.SerializationInfoTable.TryGetValue(this, out var value);
1123 if (value == null)
1124 {
1126 }
1127 int num = 0;
1128 IComparer comparer = null;
1130 object[] array = null;
1131 object[] array2 = null;
1133 while (enumerator.MoveNext())
1134 {
1135 switch (enumerator.Name)
1136 {
1137 case "LoadFactor":
1138 _loadFactor = value.GetSingle("LoadFactor");
1139 break;
1140 case "HashSize":
1141 num = value.GetInt32("HashSize");
1142 break;
1143 case "KeyComparer":
1144 _keycomparer = (IEqualityComparer)value.GetValue("KeyComparer", typeof(IEqualityComparer));
1145 break;
1146 case "Comparer":
1147 comparer = (IComparer)value.GetValue("Comparer", typeof(IComparer));
1148 break;
1149 case "HashCodeProvider":
1150 hashCodeProvider = (IHashCodeProvider)value.GetValue("HashCodeProvider", typeof(IHashCodeProvider));
1151 break;
1152 case "Keys":
1153 array = (object[])value.GetValue("Keys", typeof(object[]));
1154 break;
1155 case "Values":
1156 array2 = (object[])value.GetValue("Values", typeof(object[]));
1157 break;
1158 }
1159 }
1160 _loadsize = (int)(_loadFactor * (float)num);
1161 if (_keycomparer == null && (comparer != null || hashCodeProvider != null))
1162 {
1164 }
1165 _buckets = new bucket[num];
1166 if (array == null)
1167 {
1169 }
1170 if (array2 == null)
1171 {
1173 }
1174 if (array.Length != array2.Length)
1175 {
1177 }
1178 for (int i = 0; i < array.Length; i++)
1179 {
1180 if (array[i] == null)
1181 {
1183 }
1184 Insert(array[i], array2[i], add: true);
1185 }
1186 _version = value.GetInt32("Version");
1188 }
1189}
static int GetPrime(int min)
static int ExpandPrime(int oldSize)
static ConditionalWeakTable< object, SerializationInfo > SerializationInfoTable
HashtableEnumerator(Hashtable hashtable, int getObjRetType)
Definition Hashtable.cs:329
void CopyTo(Array array, int arrayIndex)
Definition Hashtable.cs:38
override void CopyTo(Array array, int arrayIndex)
Definition Hashtable.cs:213
override bool ContainsValue(object key)
Definition Hashtable.cs:205
override IDictionaryEnumerator GetEnumerator()
Definition Hashtable.cs:234
override void OnDeserialization(object sender)
Definition Hashtable.cs:247
override bool ContainsKey(object key)
Definition Hashtable.cs:196
override KeyValuePairs[] ToKeyValuePairsArray()
Definition Hashtable.cs:251
override bool Contains(object key)
Definition Hashtable.cs:191
SyncHashtable(SerializationInfo info, StreamingContext context)
Definition Hashtable.cs:164
override void GetObjectData(SerializationInfo info, StreamingContext context)
Definition Hashtable.cs:170
override void Add(object key, object value)
Definition Hashtable.cs:175
void CopyTo(Array array, int arrayIndex)
Definition Hashtable.cs:80
virtual void CopyTo(Array array, int arrayIndex)
Definition Hashtable.cs:811
Hashtable(int capacity, IHashCodeProvider? hcp, IComparer? comparer)
Definition Hashtable.cs:594
virtual bool Contains(object key)
Definition Hashtable.cs:719
virtual IDictionaryEnumerator GetEnumerator()
Definition Hashtable.cs:904
IEnumerator IEnumerable. GetEnumerator()
Definition Hashtable.cs:899
virtual void GetObjectData(SerializationInfo info, StreamingContext context)
uint InitHash(object key, int hashsize, out uint seed, out uint incr)
Definition Hashtable.cs:669
Hashtable(int capacity, float loadFactor, IHashCodeProvider? hcp, IComparer? comparer)
Definition Hashtable.cs:626
Hashtable(int capacity, float loadFactor)
Definition Hashtable.cs:554
virtual int GetHash(object key)
Definition Hashtable.cs:909
Hashtable(IDictionary d, float loadFactor)
Definition Hashtable.cs:609
IEqualityComparer? EqualityComparer
Definition Hashtable.cs:477
virtual ICollection Values
Definition Hashtable.cs:534
void CopyValues(Array array, int arrayIndex)
Definition Hashtable.cs:849
Hashtable(int capacity, float loadFactor, IEqualityComparer? equalityComparer)
Definition Hashtable.cs:576
void CopyEntries(Array array, int arrayIndex)
Definition Hashtable.cs:796
virtual KeyValuePairs[] ToKeyValuePairsArray()
Definition Hashtable.cs:832
Hashtable(int capacity, IEqualityComparer? equalityComparer)
Definition Hashtable.cs:599
Hashtable(IDictionary d, float loadFactor, IHashCodeProvider? hcp, IComparer? comparer)
Definition Hashtable.cs:636
Hashtable(IEqualityComparer? equalityComparer)
Definition Hashtable.cs:588
volatile bool _isWriterInProgress
Definition Hashtable.cs:407
virtual bool ContainsValue(object? value)
Definition Hashtable.cs:754
IHashCodeProvider? hcp
Definition Hashtable.cs:417
void Insert(object key, object nvalue, bool add)
Definition Hashtable.cs:935
virtual void OnDeserialization(object? sender)
void rehash(int newsize)
Definition Hashtable.cs:879
void CopyKeys(Array array, int arrayIndex)
Definition Hashtable.cs:782
virtual bool ContainsKey(object key)
Definition Hashtable.cs:724
virtual bool KeyEquals(object? item, object key)
Definition Hashtable.cs:918
IEqualityComparer _keycomparer
Definition Hashtable.cs:413
void putEntry(bucket[] newBuckets, object key, object nvalue, int hashcode)
virtual void Remove(object key)
Hashtable(IDictionary d, float loadFactor, IEqualityComparer? equalityComparer)
Definition Hashtable.cs:650
virtual ICollection Keys
Definition Hashtable.cs:532
Hashtable(IDictionary d, IEqualityComparer? equalityComparer)
Definition Hashtable.cs:620
Hashtable(SerializationInfo info, StreamingContext context)
Definition Hashtable.cs:664
virtual void Add(object key, object? value)
Definition Hashtable.cs:676
static Hashtable Synchronized(Hashtable table)
Hashtable(IDictionary d, IHashCodeProvider? hcp, IComparer? comparer)
Definition Hashtable.cs:615
Hashtable(IHashCodeProvider? hcp, IComparer? comparer)
Definition Hashtable.cs:583
static string InvalidOperation_EnumNotStarted
Definition SR.cs:46
static string ArgumentNull_Dictionary
Definition SR.cs:26
static string Serialization_MissingValues
Definition SR.cs:74
static string Serialization_MissingKeys
Definition SR.cs:1892
static string ArgumentOutOfRange_HashtableLoadFactor
Definition SR.cs:1024
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string Arg_ArrayPlusOffTooSmall
Definition SR.cs:16
static string ArgumentNull_Array
Definition SR.cs:24
static string Serialization_InvalidOnDeser
Definition SR.cs:38
static string Argument_AddingDuplicate__
Definition SR.cs:458
static string InvalidOperation_EnumFailedVersion
Definition SR.cs:44
static string Arg_RankMultiDimNotSupported
Definition SR.cs:18
static string ArgumentNull_Key
Definition SR.cs:28
static string Serialization_NullKey
Definition SR.cs:1900
static string Serialization_KeyValueDifferentSizes
Definition SR.cs:1888
static string InvalidOperation_EnumOpCantHappen
Definition SR.cs:48
static string Arg_CannotMixComparisonInfrastructure
Definition SR.cs:94
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
static string Arg_HTCapacityOverflow
Definition SR.cs:186
static string InvalidOperation_HashInsertFailed
Definition SR.cs:1458
Definition SR.cs:7
new bool Equals(object? x, object? y)