예제 #1
0
파일: PhoneNumber.cs 프로젝트: lanicon/Styx
        /// <summary>
        /// Compares two instances of this object.
        /// </summary>
        /// <param name="PhoneNumber1">A phone number.</param>
        /// <param name="PhoneNumber2">Another phone number.</param>
        /// <returns>true|false</returns>
        public static Boolean operator ==(PhoneNumber PhoneNumber1, PhoneNumber PhoneNumber2)
        {
            // If both are null, or both are same instance, return true.
            if (Object.ReferenceEquals(PhoneNumber1, PhoneNumber2))
            {
                return(true);
            }

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

            return(PhoneNumber1.Equals(PhoneNumber2));
        }
예제 #2
0
 /// <summary>
 /// Compares two instances of this object.
 /// </summary>
 /// <param name="PhoneNumber1">A phone number.</param>
 /// <param name="PhoneNumber2">Another phone number.</param>
 /// <returns>true|false</returns>
 public static Boolean operator !=(Phone_Number PhoneNumber1, Phone_Number PhoneNumber2)
 => !PhoneNumber1.Equals(PhoneNumber2);