Beispiel #1
0
        /// <summary>Converts the string to an email address collection.
        /// A return value indicates whether the conversion succeeded.
        /// </summary>
        /// <param name="s">
        /// A string containing an email address to convert.
        /// </param>
        /// <returns>
        /// The email address if the string was converted successfully, otherwise an empty EmailAddressCollection().
        /// </returns>
        public static EmailAddressCollection TryParse(string s)
        {
            EmailAddressCollection val;

            if (EmailAddressCollection.TryParse(s, out val))
            {
                return(val);
            }
            return(new EmailAddressCollection());
        }
Beispiel #2
0
        /// <summary>Converts the string to an email address collection.</summary>
        /// <param name="s">
        /// A string containing an email address to convert.
        /// </param>
        /// <param name="formatProvider">
        /// The specified format provider.
        /// </param>
        /// <returns>
        /// An email address.
        /// </returns>
        /// <exception cref="FormatException">
        /// s is not in the correct format.
        /// </exception>
        public static EmailAddressCollection Parse(string s, IFormatProvider formatProvider)
        {
            EmailAddressCollection val;

            if (EmailAddressCollection.TryParse(s, formatProvider, out val))
            {
                return(val);
            }
            throw new FormatException(QowaivMessages.FormatExceptionEmailAddressCollection);
        }