Пример #1
0
        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="MeterType1">A meter type.</param>
        /// <param name="MeterType2">Another meter type.</param>
        /// <returns>true|false</returns>
        public static Boolean operator >(MeterTypes MeterType1, MeterTypes MeterType2)
        {
            if ((Object)MeterType1 == null)
            {
                throw new ArgumentNullException(nameof(MeterType1), "The given MeterType1 must not be null!");
            }

            return(MeterType1.CompareTo(MeterType2) > 0);
        }
Пример #2
0
        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="MeterType1">A meter type.</param>
        /// <param name="MeterType2">Another meter type.</param>
        /// <returns>true|false</returns>
        public static Boolean operator ==(MeterTypes MeterType1, MeterTypes MeterType2)
        {
            // If both are null, or both are same instance, return true.
            if (ReferenceEquals(MeterType1, MeterType2))
            {
                return(true);
            }

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

            return(MeterType1.Equals(MeterType2));
        }