예제 #1
0
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            int hash = HashHelpers.Combine(this.R.GetHashCode(), this.G.GetHashCode());

            hash = HashHelpers.Combine(hash, this.B.GetHashCode());
            return(HashHelpers.Combine(hash, this.A.GetHashCode()));
        }
예제 #2
0
        /// <summary>
        /// Returns the hash code for this instance.
        /// </summary>
        /// <returns>The hash code.</returns>
        public override readonly int GetHashCode()
        {
            int hash = this.X.GetHashCode();

            hash = HashHelpers.Combine(hash, this.Y.GetHashCode());
            return(hash);
        }
예제 #3
0
        public int GetGetBinderEquivalenceHash()
        {
            int hash = _callingContext?.GetHashCode() ?? 0;

            hash = HashHelpers.Combine(hash, Name.GetHashCode());
            return(hash);
        }
예제 #4
0
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            int hash = this.X.GetHashCode();

            hash = HashHelpers.Combine(hash, this.Y.GetHashCode());
            return(HashHelpers.Combine(hash, this.Z.GetHashCode()));
        }
예제 #5
0
        /// <inheritdoc />
        public override int GetHashCode()
        {
#if NO_HASHCODE
            return(HashHelpers.Combine(PageNumber.GetHashCode(), TotalPages.GetHashCode()));
#else
            return(HashCode.Combine(PageNumber, TotalPages));
#endif
        }
예제 #6
0
        /// <inheritdoc />
        public override int GetHashCode()
        {
#if NO_HASHCODE
            return(HashHelpers.Combine(_offset.GetHashCode(), _length.GetHashCode()));
#else
            return(HashCode.Combine(_offset, _length));
#endif
        }
예제 #7
0
        /// <inheritdoc />
        public override int GetHashCode()
        {
#if NO_HASHCODE
            return(HashHelpers.Combine(Width.GetHashCode(), Height.GetHashCode()));
#else
            return(HashCode.Combine(Width, Height));
#endif
        }
예제 #8
0
        /// <inheritdoc/>
        public override int GetHashCode()
        {
            int hash = this.L.GetHashCode();

            hash = HashHelpers.Combine(hash, this.C.GetHashCode());
            hash = HashHelpers.Combine(hash, this.H.GetHashCode());
            return(HashHelpers.Combine(hash, this.WhitePoint.GetHashCode()));
        }
예제 #9
0
        /// <summary>
        /// Gets a hash code for the current object.
        /// </summary>
        /// <returns>A hash code for the current object.</returns>
        public override int GetHashCode()
        {
#if NO_HASHCODE
            return(HashHelpers.Combine((C << 16 | M).GetHashCode(), (Y << 16 | K).GetHashCode()));
#else
            return(HashCode.Combine(C, M, Y, K));
#endif
        }
예제 #10
0
        /// <inheritdoc />
        public override int GetHashCode()
        {
#if NO_HASHCODE
            return(HashHelpers.Combine(X.GetHashCode(), Y.GetHashCode()));
#else
            return(HashCode.Combine(X, Y));
#endif
        }
예제 #11
0
        /// <summary>
        /// Gets a hash code for the current object.
        /// </summary>
        /// <returns>A hash code for the current object.</returns>
        public override int GetHashCode()
        {
#if NO_HASHCODE
            return(HashHelpers.Combine((B << 16 | G).GetHashCode(), (R << 16 | A).GetHashCode()));
#else
            return(HashCode.Combine(B, G, R, A));
#endif
        }
예제 #12
0
        /// <inheritdoc />
        public override int GetHashCode()
        {
#if NO_HASHCODE
            return(HashHelpers.Combine(Numerator.GetHashCode(), Denominator.GetHashCode()));
#else
            return(HashCode.Combine(Numerator, Denominator));
#endif
        }
예제 #13
0
        public int GetGetBinderEquivalenceHash()
        {
            int hash = _callingContext?.GetHashCode() ?? 0;

            hash = HashHelpers.Combine(hash, (int)_flags);
            hash = BinderHelper.AddArgHashes(hash, _argumentInfo);

            return(hash);
        }
예제 #14
0
 public ArrayOfType(Type[] t)
 {
     this.Array    = t;
     this.HashCode = 0;
     for (int i = 0; i < t.Length; i++)
     {
         this.HashCode = HashHelpers.Combine(this.HashCode, t[i].GetHashCode());
     }
 }
예제 #15
0
        /// <summary>
        /// Gets a hash code for the current object.
        /// </summary>
        /// <returns>A hash code.</returns>
        public override int GetHashCode() =>
        HashHelpers.Combine(
#if NET5_0 || NETSTANDARD2_1
            Name?.GetHashCode(StringComparison.Ordinal) ?? 0,
#else
            Name?.GetHashCode() ?? 0,
#endif
            Type?.GetHashCode() ?? 0
            );
예제 #16
0
        private int GetHashCode(Point point)
        {
            int num       = point.X;
            int hashCode1 = num.GetHashCode();

            num = point.Y;
            int hashCode2 = num.GetHashCode();

            return(HashHelpers.Combine(hashCode1, hashCode2));
        }
예제 #17
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     return(HashHelpers.Combine(
                this.DCTEncodeVersion.GetHashCode(),
                HashHelpers.Combine(
                    this.APP14Flags0.GetHashCode(),
                    HashHelpers.Combine(
                        this.APP14Flags1.GetHashCode(),
                        this.ColorTransform.GetHashCode()))));
 }
예제 #18
0
 /// <inheritdoc/>
 public override int GetHashCode()
 {
     return(HashHelpers.Combine(
                this.MajorVersion.GetHashCode(),
                HashHelpers.Combine(
                    this.MinorVersion.GetHashCode(),
                    HashHelpers.Combine(
                        this.DensityUnits.GetHashCode(),
                        HashHelpers.Combine(this.XDensity, this.YDensity)))));
 }
        public int GetGetBinderEquivalenceHash()
        {
            int hash = _callingContext?.GetHashCode() ?? 0;

            hash = HashHelpers.Combine(hash, (int)Operation);
            if (IsChecked)
            {
                hash = HashHelpers.Combine(hash, 1);
            }
            hash = BinderHelper.AddArgHashes(hash, _argumentInfo);

            return(hash);
        }
예제 #20
0
        public int GetGetBinderEquivalenceHash()
        {
            int hash = _callingContext?.GetHashCode() ?? 0;

            hash = HashHelpers.Combine(hash, (int)ConversionKind);
            if (IsChecked)
            {
                hash = HashHelpers.Combine(hash, 1);
            }

            hash = HashHelpers.Combine(hash, Type.GetHashCode());
            return(hash);
        }
예제 #21
0
        public int GetGetBinderEquivalenceHash()
        {
            int hash = _callingContext?.GetHashCode() ?? 0;

            if (ResultIndexed)
            {
                hash = HashHelpers.Combine(hash, 1);
            }
            hash = HashHelpers.Combine(hash, Name.GetHashCode());
            hash = BinderHelper.AddArgHashes(hash, _argumentInfo);

            return(hash);
        }
예제 #22
0
        public int GetHashCode(string assemblyQualifiedTypeName)
        {
            // non-allocating GetHashCode that hashes the type name portion of the string
            ReadOnlySpan <char> typeSpan = assemblyQualifiedTypeName.AsSpan().TrimStart(s_whiteSpaceChars);
            ReadOnlySpan <char> typeName = ReadTypeName(typeSpan);

            int hashCode = 0;

            for (int i = 0; i < typeName.Length; i++)
            {
                hashCode = HashHelpers.Combine(hashCode, typeName[i].GetHashCode());
            }

            return(hashCode);
        }
예제 #23
0
        public override int GetHashCode()
        {
            // Three cases:
            // 1. We don't have a name. All relevant data, including this fact, is in the remaining fields.
            // 2. We have a known name. The name will be the same instance of any other with the same
            // knownColor value, so we can ignore it for hashing. Note this also hashes different to
            // an unnamed color with the same ARGB value.
            // 3. Have an unknown name. Will differ from other unknown-named colors only by name, so we
            // can usefully use the names hash code alone.
            if (name != null & !IsKnownColor)
            {
                return(name.GetHashCode());
            }

            return(HashHelpers.Combine(
                       HashHelpers.Combine(value.GetHashCode(), state.GetHashCode()), knownColor.GetHashCode()));
        }
예제 #24
0
 public override int GetHashCode() => HashHelpers.Combine(Width.GetHashCode(), Height.GetHashCode());
예제 #25
0
 public override int GetHashCode() => HashHelpers.Combine(this.X.GetHashCode(), this.Y.GetHashCode());
예제 #26
0
 public int GetHashCode(ParameterInfo obj)
 {
     return(HashHelpers.Combine(obj.Position.GetHashCode(), obj.Member.GetHashCode()));
 }
예제 #27
0
 /// <summary>
 /// Gets a hash code for the instance.
 /// </summary>
 /// <returns>The hash code.</returns>
 public override int GetHashCode() =>
 HashHelpers.Combine(
     FastEqualityComparer <TNonCached> .Default.GetHashCode(NonCached),
     FastEqualityComparer <TCached> .Default.GetHashCode(Cached)
     );
예제 #28
0
 public override int GetHashCode() =>
 HashHelpers.Combine(HashHelpers.Combine(HashHelpers.Combine(X, Y), Width), Height);
예제 #29
0
 public override int GetHashCode() =>
 HashHelpers.Combine(Name.GetHashCode(), Version.GetHashCode());
예제 #30
0
 public override int GetHashCode() => HashHelpers.Combine(X.GetHashCode(), Y.GetHashCode());