public override bool Equals(object obj)
        {
            var other = obj as ContentDispositionHeaderValue;

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

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

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

            return((string.Compare(_unit, other._unit, StringComparison.OrdinalIgnoreCase) == 0) &&
                   HeaderUtilities.AreEqualCollections(Ranges, other.Ranges));
        }
        public override bool Equals(object obj)
        {
            var 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) ||
                (_public != other._public) || (_private != other._private) ||
                (_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);
        }