Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetObjectData()

virtual void System.Collections.Hashtable.GetObjectData ( SerializationInfo info,
StreamingContext context )
inlinevirtualinherited

Implements System.Runtime.Serialization.ISerializable.

Reimplemented in System.Collections.Hashtable.SyncHashtable.

Definition at line 1075 of file Hashtable.cs.

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);
1086 IEqualityComparer keycomparer = _keycomparer;
1087 if (keycomparer == null)
1088 {
1089 info.AddValue("Comparer", null, typeof(IComparer));
1090 info.AddValue("HashCodeProvider", null, typeof(IHashCodeProvider));
1091 }
1092 else if (keycomparer is CompatibleComparer)
1093 {
1094 CompatibleComparer compatibleComparer = keycomparer as CompatibleComparer;
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 {
1111 throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion);
1112 }
1113 }
1114 }
void CopyValues(Array array, int arrayIndex)
Definition Hashtable.cs:849
void CopyKeys(Array array, int arrayIndex)
Definition Hashtable.cs:782
IEqualityComparer _keycomparer
Definition Hashtable.cs:413

References System.Collections.Hashtable._buckets, System.Collections.Hashtable._count, System.Collections.Hashtable._keycomparer, System.Collections.Hashtable._loadFactor, System.Collections.Hashtable._version, System.array, System.Collections.Hashtable.CopyKeys(), System.Collections.Hashtable.CopyValues(), System.Runtime.Serialization.Dictionary, System.info, System.SR.InvalidOperation_EnumFailedVersion, and System.Collections.Hashtable.SyncRoot.