Inheritance: IEqualityComparer
Example #1
0
 public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
 {
     if (info == null)
     {
         throw new ArgumentNullException("info");
     }
     info.AddValue("LoadFactor", this.loadFactor);
     info.AddValue("Version", (int)this.version);
     if (this._keycomparer == null)
     {
         info.AddValue("Comparer", null, typeof(IComparer));
         info.AddValue("HashCodeProvider", null, typeof(IHashCodeProvider));
     }
     else if (this._keycomparer is CompatibleComparer)
     {
         CompatibleComparer comparer = this._keycomparer as CompatibleComparer;
         info.AddValue("Comparer", comparer.Comparer, typeof(IComparer));
         info.AddValue("HashCodeProvider", comparer.HashCodeProvider, typeof(IHashCodeProvider));
     }
     else
     {
         info.AddValue("KeyComparer", this._keycomparer, typeof(IEqualityComparer));
     }
     info.AddValue("HashSize", this.buckets.Length);
     object[] array     = new object[this.count];
     object[] objArray2 = new object[this.count];
     this.CopyKeys(array, 0);
     this.CopyValues(objArray2, 0);
     info.AddValue("Keys", array, typeof(object[]));
     info.AddValue("Values", objArray2, typeof(object[]));
 }