Esempio n. 1
0
        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="Hostname1">A HTTPHostname.</param>
        /// <param name="Hostname2">Another HTTPHostname.</param>
        /// <returns>true|false</returns>
        public static Boolean operator >(HTTPHostname Hostname1, HTTPHostname Hostname2)
        {
            if ((Object)Hostname1 == null)
            {
                throw new ArgumentNullException("The given Hostname1 must not be null!");
            }

            return(Hostname1.CompareTo(Hostname2) > 0);
        }
Esempio n. 2
0
        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="Hostname1">A HTTPHostname.</param>
        /// <param name="Hostname2">Another HTTPHostname.</param>
        /// <returns>true|false</returns>
        public static Boolean operator ==(HTTPHostname Hostname1, HTTPHostname Hostname2)
        {
            // If both are null, or both are same instance, return true.
            if (Object.ReferenceEquals(Hostname1, Hostname2))
            {
                return(true);
            }

            // If one is null, but not both, return false.
            if (((Object)Hostname1 == null) || ((Object)Hostname2 == null))
            {
                return(false);
            }

            return(Hostname1.Equals(Hostname2));
        }