GetHashCode() public method

Try to keep this reasonable in [....] with Equals(). Specifically, if A.Equals(B) returns true, A & B should have the same hash code.
public GetHashCode ( ) : int
return int
Ejemplo n.º 1
0
            public ValueTableKey(object item, PropertyDescriptor pd)
            {
                Invariant.Assert(item != null && pd != null);

                // store weak references to item and pd, so as not to affect their
                // GC behavior.  But remember their hashcode.
                _item = new WeakReference(item);
                _descriptor = new WeakReference(pd);
                _hashCode = unchecked(item.GetHashCode() + pd.GetHashCode());
            }
Ejemplo n.º 2
0
 public override int GetHashCode()
 {
     return(extender.GetHashCode() ^ extenderProvider.GetHashCode() ^ receiver.GetHashCode());
 }