Esempio n. 1
0
        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="HTTPContentType">An object to compare with.</param>
        public Int32 CompareTo(HTTPContentType HTTPContentType)
        {
            if ((Object)HTTPContentType == null)
            {
                throw new ArgumentNullException("The given HTTPContentType must not be null!");
            }

            return(MediaType.CompareTo(HTTPContentType.MediaType));
        }
Esempio n. 2
0
        public int CompareTo(CodecMatch other)
        {
            if (other?.CodecRegistration == null)
            {
                return(1);
            }
            if (ReferenceEquals(this, other))
            {
                return(0);
            }
            if (WeightedScore == other.WeightedScore)
            {
                return(MatchingParameterCount == other.MatchingParameterCount
          ? MediaType.CompareTo(other.MediaType)
          : MatchingParameterCount.CompareTo(other.MatchingParameterCount));
            }

            return(WeightedScore.CompareTo(other.WeightedScore));
        }