The following example assigns a culture to a site.
privatebool AddCultureToSite() { // Get site and culture objects SiteInfo site = SiteInfoProvider.GetSiteInfo("MyNewSite"); CultureInfo culture = CultureInfoProvider.GetCultureInfo("ar-sa");
if ((site != null) && (culture != null)) { // Add culture to site CultureSiteInfoProvider.AddCultureToSite(culture.CultureID, site.SiteID);
returntrue; }
returnfalse; }
The following example removes a culture from a site.
privatebool RemoveCultureFromSite() { // Get site and culture objects SiteInfo site = SiteInfoProvider.GetSiteInfo("MyNewSite"); CultureInfo culture = CultureInfoProvider.GetCultureInfo("ar-sa"); if ((site != null) && (culture != null)) {
// Delete the culture site CultureSiteInfoProvider.RemoveCultureFromSite(culture.CultureID, site.SiteID);