Пример #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (Prop1 != null ? Prop1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Prop2 != null ? Prop2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (EnumArray != null ? EnumArray.GetHashCode() : 0);
         return(hashCode);
     }
 }
Пример #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                // Choose large primes to avoid hashing collisions
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ Prop0.GetHashCode();
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop1) ? Prop1.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop2) ? Prop2.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop3) ? Prop3.GetHashCode() : 0);
                return(hash);
            }
        }
Пример #3
0
        public override int GetHashCode()
        {
            unchecked
            {
                // Choose large primes to avoid hashing collisions
                const int HashingBase       = (int)2166136261;
                const int HashingMultiplier = 16777619;

                int hash = HashingBase;
                hash = (hash * HashingMultiplier) ^ Prop0.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop1.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop2.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop3.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop4.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop5.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop6.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop7.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop8.GetHashCode();
                hash = (hash * HashingMultiplier) ^ Prop9.GetHashCode();
                return(hash);
            }
        }
Пример #4
0
 public override int GetHashCode()
 {
     return(Prop2.GetHashCode());
 }