示例#1
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);
            }
        }
示例#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) ^
                       (!object.ReferenceEquals(null, Prop0) ? Prop0.GetHashCode() : 0);
                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);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop4) ? Prop4.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop5) ? Prop5.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop6) ? Prop6.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop7) ? Prop7.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop8) ? Prop8.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop9) ? Prop9.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop10) ? Prop10.GetHashCode() : 0);
                hash = (hash * HashingMultiplier) ^
                       (!object.ReferenceEquals(null, Prop11) ? Prop11.GetHashCode() : 0);
                return(hash);
            }
        }