GetCategories() public méthode

public GetCategories ( Kooboo.CMS.Sites.Models.Site site ) : IEnumerable
site Kooboo.CMS.Sites.Models.Site
Résultat IEnumerable
Exemple #1
0
        public void Import(Site site, Stream zipStream, bool @override)
        {
            var tempFolder = GetImportExportTempFolder(site);

            Kooboo.IO.IOUtility.DeleteDirectory(tempFolder, true);

            using (ZipFile zipFile = ZipFile.Read(zipStream))
            {
                var action = ExtractExistingFileAction.OverwriteSilently;
                zipFile.ExtractAll(tempFolder, action);
            }

            var categories = new[] { "" }.Concat(LabelProvider.GetCategories(tempFolder));

            foreach (var item in categories)
            {
                var storage = GetStorage(GetImportExportLabelFile(site, item));
                foreach (var label in storage.GetList().ToArray())
                {
                    site.Site = site;
                    _rawLabelProvider.Add(label);
                }
            }
            Kooboo.IO.IOUtility.DeleteDirectory(tempFolder, true);
        }