/// <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> // ReSharper disable once UnusedMember.Global public Website GetFirstChoice(WebsiteTypes siteType) { Website alternate = null; foreach (var webSite in this) { if ((webSite.WebsiteType & siteType) == siteType) { return(webSite); } if ((alternate == null) && (webSite.WebsiteType == WebsiteTypes.Default)) { alternate = webSite; } } return(alternate); }
/// <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 Website(string url, WebsiteTypes websiteType) { _url = url ?? string.Empty; WebsiteType = websiteType; }