Пример #1
0
 /// <summary>
 /// Return the HashCode of this object.
 /// </summary>
 /// <returns>The HashCode of this object.</returns>
 public override Int32 GetHashCode()
 {
     unchecked
     {
         return(_Weekday.GetHashCode() * 23 ^ _Begin.GetHashCode() * 17 ^ _End.GetHashCode());
     }
 }
Пример #2
0
        //public override bool Equals(object obj)
        //{
        //    CellQuery snd = obj as CellQuery;
        //    return Equals2(snd);
        //}

        //public bool Equals2(CellQuery other)
        //{
        //    if (other == null)
        //        return false;
        //    if (hash != other.hash)
        //        return false;
        //    bool b = (other.latmax != latmax) ||
        //         (other.latmin != latmin) ||
        //         (other.lonmax != lonmax) ||
        //         (other.lonmin != lonmin) ||
        //         (other.DayMax != DayMax) ||
        //         (other.DayMin != DayMin) ||
        //         (other.HourMax != HourMax) ||
        //         (other.HourMin != HourMin) ||
        //         (other.YearMax != YearMax) ||
        //         (other.YearMin != YearMin) ||
        //         (other.parameter != parameter);
        //    return !b;
        //}


        public override int GetHashCode()
        {
            //TODO save hashing results
            int r = (int)parameter << 2 ^
                    base.GetHashCode() ^
                    YearMin.GetHashCode() ^
                    YearMax.GetHashCode() << 1 ^
                    DayMin.GetHashCode() ^
                    DayMax.GetHashCode() << 2 ^
                    HourMin.GetHashCode() ^
                    HourMax.GetHashCode() >> 2 ^
                    (int)landOceanCoverage << 3;

            return(r);
        }