/// <summary>
        /// Adds a specific <see cref="SyncBase.DetailData.PhoneNumber"/> to the google address list of a google contact
        /// </summary>
        /// <param name="googleContact">The google contact.</param>
        /// <param name="stdPhoneNumber">The std phone number.</param>
        /// <param name="addressType">The address type.</param>
        public static void AddPhoneNumber(this Contact googleContact, PhoneNumber stdPhoneNumber, string addressType)
        {
            if (stdPhoneNumber == null || string.IsNullOrEmpty(stdPhoneNumber.ToString()))
            {
                return;
            }

            var phone = new global::Google.GData.Extensions.PhoneNumber(stdPhoneNumber.ToString())
            {
                Rel = GoogleSchemaPrefix2005 + addressType
            };

            googleContact.Phonenumbers.Add(phone);
        }
Beispiel #2
0
        /// <summary>
        /// Compares the content of this instance to another instance of the <see cref="PhoneNumber"/> class based on the <see cref="ToString"/> method.
        /// </summary>
        /// <param name="other">
        /// The other instance.
        /// </param>
        /// <returns>
        /// true if the content does match
        /// </returns>
        public bool Equals(PhoneNumber other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(other.ToString().Equals(this.ToString()));
        }