Esempio n. 1
0
        //IMPORTANT: this part uses the fact that GetHashCode() is consistent with the notion of equality in the set
        public int GetHashCode(ObservableSortedSet <T> obj)
        {
            int hashCode = 0;

            foreach (T t in obj)
            {
                hashCode ^= EqualityComparer.GetHashCode(t) & 0x7FFFFFFF;
            }

            return(hashCode);
        }
Esempio n. 2
0
 // using comparer to keep equals properties in tact; don't want to choose one of the comparers
 public bool Equals(ObservableSortedSet <T> x, ObservableSortedSet <T> y)
 {
     return(ObservableSortedSet <T> .SetEquals(x, y, Comparer));
 }