Пример #1
0
        public override bool Equals(object obj)
        {
            RangeHeaderValue other = obj as RangeHeaderValue;

            if (other == null)
            {
                return(false);
            }

            return(string.Equals(_unit, other._unit, StringComparison.OrdinalIgnoreCase) &&
                   HeaderUtilities.AreEqualCollections(_ranges, other._ranges));
        }
Пример #2
0
        public override bool Equals([NotNullWhen(true)] object?obj)
        {
            TransferCodingHeaderValue?other = obj as TransferCodingHeaderValue;

            if (other == null)
            {
                return(false);
            }

            return(string.Equals(_value, other._value, StringComparison.OrdinalIgnoreCase) &&
                   HeaderUtilities.AreEqualCollections(_parameters, other._parameters));
        }
        public override bool Equals(object obj)
        {
            MediaTypeHeaderValue other = obj as MediaTypeHeaderValue;

            if (other == null)
            {
                return(false);
            }

            return((string.Compare(mediaType, other.mediaType, StringComparison.OrdinalIgnoreCase) == 0) &&
                   HeaderUtilities.AreEqualCollections(parameters, other.parameters));
        }
Пример #4
0
        public override bool Equals(object obj)
        {
            ContentDispositionHeaderValue other = obj as ContentDispositionHeaderValue;

            if (other == null)
            {
                return(false);
            }

            return(string.Equals(_dispositionType, other._dispositionType, StringComparison.OrdinalIgnoreCase) &&
                   HeaderUtilities.AreEqualCollections(_parameters, other._parameters));
        }
Пример #5
0
        public override bool Equals(object obj)
        {
            TransferCodingHeaderValue other = obj as TransferCodingHeaderValue;

            if (other == null)
            {
                return(false);
            }

            return((string.Compare(_value, other._value, StringComparison.OrdinalIgnoreCase) == 0) &&
                   HeaderUtilities.AreEqualCollections(_parameters, other._parameters));
        }
Пример #6
0
        public override bool Equals(object obj)
        {
            bool result = base.Equals(obj);

            if (result)
            {
                NameValueWithParametersHeaderValue other = obj as NameValueWithParametersHeaderValue;

                if (other == null)
                {
                    return(false);
                }
                return(HeaderUtilities.AreEqualCollections(parameters, other.parameters));
            }

            return(false);
        }
        public override bool Equals(object obj)
        {
            CacheControlHeaderValue other = obj as CacheControlHeaderValue;

            if (other == null)
            {
                return(false);
            }

            if ((_noCache != other._noCache) || (_noStore != other._noStore) || (_maxAge != other._maxAge) ||
                (_sharedMaxAge != other._sharedMaxAge) || (_maxStale != other._maxStale) ||
                (_maxStaleLimit != other._maxStaleLimit) || (_minFresh != other._minFresh) ||
                (_noTransform != other._noTransform) || (_onlyIfCached != other._onlyIfCached) ||
                (_publicField != other._publicField) || (_privateField != other._privateField) ||
                (_mustRevalidate != other._mustRevalidate) || (_proxyRevalidate != other._proxyRevalidate))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(_noCacheHeaders, other._noCacheHeaders,
                                                     StringComparer.OrdinalIgnoreCase))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(_privateHeaders, other._privateHeaders,
                                                     StringComparer.OrdinalIgnoreCase))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(_extensions, other._extensions))
            {
                return(false);
            }

            return(true);
        }
Пример #8
0
        public override bool Equals(object obj)
        {
            CacheControlHeaderValue other = obj as CacheControlHeaderValue;

            if (other == null)
            {
                return(false);
            }

            if ((noCache != other.noCache) || (noStore != other.noStore) || (maxAge != other.maxAge) ||
                (sharedMaxAge != other.sharedMaxAge) || (maxStale != other.maxStale) ||
                (maxStaleLimit != other.maxStaleLimit) || (minFresh != other.minFresh) ||
                (noTransform != other.noTransform) || (onlyIfCached != other.onlyIfCached) ||
                (publicField != other.publicField) || (privateField != other.privateField) ||
                (mustRevalidate != other.mustRevalidate) || (proxyRevalidate != other.proxyRevalidate))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(noCacheHeaders, other.noCacheHeaders,
                                                     HeaderUtilities.CaseInsensitiveStringComparer))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(privateHeaders, other.privateHeaders,
                                                     HeaderUtilities.CaseInsensitiveStringComparer))
            {
                return(false);
            }

            if (!HeaderUtilities.AreEqualCollections(extensions, other.extensions))
            {
                return(false);
            }

            return(true);
        }
Пример #9
0
 /// <summary>确定指定的 <see cref="T:System.Object" /> 是否等于当前的 <see cref="T:System.Net.Http.Headers.ContentDispositionHeaderValue" /> 对象。</summary>
 /// <param name="obj">要与当前对象进行比较的对象。</param>
 /// <returns>如果指定的 <see cref="T:System.Object" /> 等于当前的对象,则为 <see langword="true" />;否则为 <see langword="false" />。</returns>
 public override bool Equals(object obj)
 {
     return(obj is ContentDispositionHeaderValue dispositionHeaderValue && string.Equals(this._dispositionType, dispositionHeaderValue._dispositionType, StringComparison.OrdinalIgnoreCase) && HeaderUtilities.AreEqualCollections <NameValueHeaderValue>(this._parameters, dispositionHeaderValue._parameters));
 }
Пример #10
0
 /// <summary>确定指定的 <see cref="T:System.Object" /> 是否等于当前的 <see cref="T:System.Net.Http.Headers.MediaTypeHeaderValue" /> 对象。</summary>
 /// <param name="obj">要与当前对象进行比较的对象。</param>
 /// <returns>如果指定的 <see cref="T:System.Object" /> 等于当前的对象,则为 <see langword="true" />;否则为 <see langword="false" />。</returns>
 public override bool Equals(object obj)
 {
     return(obj is MediaTypeHeaderValue mediaTypeHeaderValue && string.Equals(this._mediaType, mediaTypeHeaderValue._mediaType, StringComparison.OrdinalIgnoreCase) && HeaderUtilities.AreEqualCollections <NameValueHeaderValue>(this._parameters, mediaTypeHeaderValue._parameters));
 }
Пример #11
0
 internal static bool AreEqualCollections <T>(ObjectCollection <T> x, ObjectCollection <T> y) where T : class
 {
     return(HeaderUtilities.AreEqualCollections <T>(x, y, (IEqualityComparer <T>)null));
 }