Esempio n. 1
0
        public override bool Equals(object obj)
        {
            var other = obj as MediaTypeHeaderValue;

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

            return(_mediaType.Equals(other._mediaType, StringComparison.OrdinalIgnoreCase) &&
                   HeaderUtilities.AreEqualCollections(_parameters, other._parameters));
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            var other = obj as RangeHeaderValue;

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

            return(StringSegment.Equals(_unit, other._unit, StringComparison.OrdinalIgnoreCase) &&
                   HeaderUtilities.AreEqualCollections(Ranges, other.Ranges));
        }
        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));
        }
Esempio n. 4
0
        public override bool Equals(object?obj)
        {
            var other = obj as SetCookieHeaderValue;

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

            return(StringSegment.Equals(_name, other._name, StringComparison.OrdinalIgnoreCase) &&
                   StringSegment.Equals(_value, other._value, StringComparison.OrdinalIgnoreCase) &&
                   Expires.Equals(other.Expires) &&
                   MaxAge.Equals(other.MaxAge) &&
                   StringSegment.Equals(Domain, other.Domain, StringComparison.OrdinalIgnoreCase) &&
                   StringSegment.Equals(Path, other.Path, StringComparison.OrdinalIgnoreCase) &&
                   Secure == other.Secure &&
                   SameSite == other.SameSite &&
                   HttpOnly == other.HttpOnly &&
                   HeaderUtilities.AreEqualCollections(Extensions, other.Extensions, StringSegmentComparer.OrdinalIgnoreCase));
        }
Esempio n. 5
0
        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,
                                                     StringSegmentComparer.OrdinalIgnoreCase))
            {
                return(false);
            }

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

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

            return(true);
        }