예제 #1
0
파일: LabelProvider.cs 프로젝트: Godoy/CMS
 private static void ConvertFromResx(ISiteProvider siteProvider)
 {
     var sites = siteProvider.AllSites();
     var labelProvider = new LabelProvider();
     foreach (var site in sites)
     {
         var elementProvider = new SiteLabelRepository(site);
         foreach (var item in elementProvider.Elements())
         {
             labelProvider.Add(new Label(site, item.Category, item.Name, item.Value) { UtcCreationDate = DateTime.UtcNow });
         }
         elementProvider.Clear();
     }
 }
예제 #2
0
 private void ExportLabels(Site site)
 {
     var labelRepository = _elementRepositoryFactory.CreateRepository(site);
     if (labelRepository.GetType() != typeof(SiteLabelRepository))
     {
         SiteLabelRepository fileRepository = new SiteLabelRepository(site);
         fileRepository.Clear();
         foreach (var item in labelRepository.Elements())
         {
             fileRepository.Add(item);
         }
     }
 }
예제 #3
0
 private void ExportLabels(Site site)
 {
     var labelRepository = Kooboo.CMS.Sites.Globalization.DefaultRepositoryFactory.Instance.CreateRepository(site);
     if (labelRepository.GetType() != typeof(SiteLabelRepository))
     {
         SiteLabelRepository fileRepository = new SiteLabelRepository(site);
         fileRepository.Clear();
         foreach (var item in labelRepository.Elements())
         {
             fileRepository.Add(item);
         }
     }
 }