Exemplo n.º 1
0
        /// <summary>
        ///     Returns the first web site of the specified type.  If
        ///     the collection does not contain a website of the specified
        ///     type, but does contain a default (uncategorized) website,
        ///     then that website will be returned.
        /// </summary>
        /// <param name="siteType"></param>
        /// <returns></returns>
        public vCardWebsite GetFirstChoice(vCardWebsiteTypes siteType)
        {
            vCardWebsite alternate = null;

            foreach (vCardWebsite webSite in this)
            {
                if ((webSite.WebsiteType & siteType) == siteType)
                {
                    return(webSite);
                }
                else
                {
                    if (
                        (alternate == null) &&
                        (webSite.WebsiteType == vCardWebsiteTypes.Default))
                    {
                        alternate = webSite;
                    }
                }
            }

            return(alternate);
        }
Exemplo n.º 2
0
 /// <summary>
 ///     Creates a new vCardWebSite with the
 ///     specified URL and classification.
 /// </summary>
 /// <param name="url">
 ///     The URL of the web site.
 /// </param>
 /// <param name="websiteType">
 ///     The classification of the web site.
 /// </param>
 public vCardWebsite(string url, vCardWebsiteTypes websiteType)
 {
     this.url = url == null ? string.Empty : url;
     this.websiteType = websiteType;
 }
Exemplo n.º 3
0
 /// <summary>
 ///     Creates a new vCardWebSite with the
 ///     specified URL and classification.
 /// </summary>
 /// <param name="url">
 ///     The URL of the web site.
 /// </param>
 /// <param name="websiteType">
 ///     The classification of the web site.
 /// </param>
 public vCardWebsite(string url, vCardWebsiteTypes websiteType)
 {
     this.url         = url == null ? string.Empty : url;
     this.websiteType = websiteType;
 }