Exemple #1
0
        public override int GetHashCode()
        {
            if (name == null)
            {
                return(0 ^ foodGroup.GetHashCode());
            }

            return(name.GetHashCode() ^ foodGroup.GetHashCode());
        }
Exemple #2
0
 public override int GetHashCode()
 {
     // Microsoft has already implemented GetHasCode()
     // for standard .NET types
     return(_name.GetHashCode() ^ _group.GetHashCode());
     // ^ is XOR (exclusive OR)
 }
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());
 }
Exemple #4
0
 public override int GetHashCode() => _name.GetHashCode() ^ _group.GetHashCode();
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());
     //^ - Exclusive OR operator
 }
Exemple #6
0
 public override int GetHashCode()
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());// GetHashCode already impled for .NET types
 }
Exemple #7
0
 //Returns a 32-bit hash of the value of the object
 //Hash tables require that if x.Equals(y) then we must have
 //x.GetHashCode() == y.GetHashCode()
 public override int GetHashCode()
 {
     //using exclusive Or operator XOR
     return(name.GetHashCode() ^ group.GetHashCode());
 }
Exemple #8
0
 public override int GetHashCode()
 // if Equals is overridden, GetHashCod must also be overridden for
 // dictionaries (and anything else that uses hashes) to work properly
 {
     return(_name.GetHashCode() ^ _group.GetHashCode());
 }