Exemple #1
0
        /// <summary>
        /// Checks to see if two UnsuccessAddresses are equal.
        /// </summary>
        /// <param name="obj">The UnsuccessAddresses to check</param>
        /// <returns>true if obj and this are equal</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (GetType() != obj.GetType())
            {
                return(false);
            }

            DestinationAddress da = (DestinationAddress)obj;

            if (!da.IsDistributionList)
            {
                // value member check
                return
                    (DestinationAddressTon.Equals(da.DestinationAddressTon) &&
                     DestinationAddressNpi.Equals(da.DestinationAddressNpi) &&
                     DestAddress.Equals(da.DestAddress));
            }
            else
            {
                return(DistributionList.Equals(da.DistributionList));
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets the hash code for this object.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hashCode = 0;

            hashCode ^= DestinationAddress.GetHashCode();
            hashCode ^= DestinationAddressNpi.GetHashCode();
            hashCode ^= DestinationAddressTon.GetHashCode();
            hashCode ^= ErrorStatusCode.GetHashCode();

            return(hashCode);
        }
Exemple #3
0
        /// <summary>
        /// Gets the hash code for this object.
        /// </summary>
        /// <returns></returns>
        public override int GetHashCode()
        {
            int hashCode = 0;

            if (!IsDistributionList)
            {
                hashCode ^= DestAddress.GetHashCode();
                hashCode ^= DestinationAddressNpi.GetHashCode();
                hashCode ^= DestinationAddressTon.GetHashCode();
            }
            else
            {
                hashCode ^= DistributionList.GetHashCode();
            }

            return(hashCode);
        }
Exemple #4
0
        /// <summary>
        /// Checks to see if two UnsuccessAddresses are equal.
        /// </summary>
        /// <param name="obj">The UnsuccessAddresses to check</param>
        /// <returns>true if obj and this are equal</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (GetType() != obj.GetType())
            {
                return(false);
            }

            // safe because of the GetType check
            UnsuccessAddress us = (UnsuccessAddress)obj;

            // value member check
            return
                (DestinationAddressTon.Equals(us.DestinationAddressTon) &&
                 DestinationAddressNpi.Equals(us.DestinationAddressNpi) &&
                 DestinationAddress.Equals(us.DestinationAddress) &&
                 ErrorStatusCode.Equals(us.ErrorStatusCode));
        }