Ejemplo n.º 1
0
        /// <summary>
        /// Parse phone number type.
        /// </summary>
        /// <param name="name">Name of the phone number type.</param>
        /// <returns><see cref="PhoneNumberType"/> for the name.</returns>
        public static PhoneNumberType Parse(string name)
        {
            PhoneNumberType phoneNumberType = null;

            if (name == null || !PHONE_NUMBER_TYPES.TryGetValue(name, out phoneNumberType))
            {
                phoneNumberType = new PhoneNumberType(name);
            }

            return(phoneNumberType);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Determines whether this instance and another specified <see cref="PhoneNumberType"/> object have the same value.
        /// </summary>
        /// <param name="value">The phone number type to compare to this instance.</param>
        /// <returns>true if the value of the parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false.</returns>
        public bool Equals(PhoneNumberType value)
        {
            if (Object.ReferenceEquals(value, null))
            {
                return(false);
            }

            if (Object.ReferenceEquals(this, value))
            {
                return(true);
            }

            return(this.Name == value.Name);
        }