Пример #1
0
        /// <summary>
        /// Returns true if Phone instances are equal
        /// </summary>
        /// <param name="other">Instance of Phone to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Phone other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     CountryCallingCode == other.CountryCallingCode ||
                     CountryCallingCode != null &&
                     CountryCallingCode.Equals(other.CountryCallingCode)
                 ) &&
                 (
                     AreaCode == other.AreaCode ||
                     AreaCode != null &&
                     AreaCode.Equals(other.AreaCode)
                 ) &&
                 (
                     Number == other.Number ||
                     Number != null &&
                     Number.Equals(other.Number)
                 ));
        }
Пример #2
0
        /// <summary>
        /// Returns true if PhoneChannelPhone instances are equal
        /// </summary>
        /// <param name="other">Instance of PhoneChannelPhone to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(PhoneChannelPhone other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CountryCallingCode == other.CountryCallingCode ||
                     CountryCallingCode != null &&
                     CountryCallingCode.Equals(other.CountryCallingCode)
                     ) &&
                 (
                     AreaCode == other.AreaCode ||
                     AreaCode != null &&
                     AreaCode.Equals(other.AreaCode)
                 ) &&
                 (
                     Number == other.Number ||
                     Number != null &&
                     Number.Equals(other.Number)
                 ) &&
                 (
                     AdditionalInfo == other.AdditionalInfo ||
                     AdditionalInfo != null &&
                     AdditionalInfo.Equals(other.AdditionalInfo)
                 ));
        }
Пример #3
0
        /// <summary>
        /// Returns true if CommonPhoneNumber instances are equal
        /// </summary>
        /// <param name="other">Instance of CommonPhoneNumber to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CommonPhoneNumber other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     IsPreferred == other.IsPreferred ||
                     IsPreferred != null &&
                     IsPreferred.Equals(other.IsPreferred)
                     ) &&
                 (
                     Purpose == other.Purpose ||
                     Purpose != null &&
                     Purpose.Equals(other.Purpose)
                 ) &&
                 (
                     CountryCode == other.CountryCode ||
                     CountryCode != null &&
                     CountryCode.Equals(other.CountryCode)
                 ) &&
                 (
                     AreaCode == other.AreaCode ||
                     AreaCode != null &&
                     AreaCode.Equals(other.AreaCode)
                 ) &&
                 (
                     Number == other.Number ||
                     Number != null &&
                     Number.Equals(other.Number)
                 ) &&
                 (
                     Extension == other.Extension ||
                     Extension != null &&
                     Extension.Equals(other.Extension)
                 ) &&
                 (
                     FullNumber == other.FullNumber ||
                     FullNumber != null &&
                     FullNumber.Equals(other.FullNumber)
                 ));
        }
Пример #4
0
 /// <summary>
 /// Determines if two PhoneNumber objects are equal.
 /// </summary>
 /// <param name="other">The other phone number.</param>
 /// <returns><c>true</c> if equal, <c>false</c> otherwise.</returns>
 public bool Equals(PhoneNumber other)
 {
     return(AreaCode.Equals(other.AreaCode) && ExchangeCode.Equals(other.ExchangeCode) && SubscriberNumber.Equals(other.SubscriberNumber));
 }