Пример #1
0
        private void InitializeLabels(Site site)
        {
            var labelRepository = _elementRepositoryFactory.CreateRepository(site);

            if (labelRepository.GetType() != typeof(SiteLabelRepository))
            {
                labelRepository.Clear();
                SiteLabelRepository fileRepository = new SiteLabelRepository(site);
                foreach (var item in fileRepository.Elements())
                {
                    labelRepository.Add(item);
                }
            }
        }
Пример #2
0
 private void ClearSiteData(Site site)
 {
     try
     {
         _elementRepositoryFactory.CreateRepository(site).Clear();
     }
     catch
     {
     }
     try
     {
         Kooboo.CMS.Sites.Persistence.Providers.PageProvider.Clear(site);
     }
     catch
     {
     }
     try
     {
         Kooboo.CMS.Sites.Persistence.Providers.HtmlBlockProvider.Clear(site);
     }
     catch
     {
     }
 }