protected override void ProcessSlideSizeFolder(StorageDirectory sizeFolder, SlideFormatEnum format)
        {
            var orderFiles = new[]
            {
                Path.Combine(sizeFolder.LocalPath, "thumb_order.txt"),
                Path.Combine(sizeFolder.LocalPath, "slide_order.txt")
            };

            var orderFile = orderFiles.FirstOrDefault(File.Exists);

            if (orderFile == null)
            {
                return;
            }

            var folderNames = File.ReadAllLines(orderFile).Where(line => !String.IsNullOrWhiteSpace(line)).ToList();

            foreach (var folderName in folderNames)
            {
                var slideContentsFolder  = new StorageDirectory(sizeFolder.RelativePathParts.Merge(folderName));
                var slideTemplatesFolder = new StorageDirectory(_slideTemplatesDirectory.RelativePathParts.Merge(
                                                                    new[] { sizeFolder.RelativePathParts.Last(), folderName }));
                if (slideContentsFolder.ExistsLocal())
                {
                    var slideMaster = new SlideMaster(slideContentsFolder, slideTemplatesFolder)
                    {
                        Group  = "Default",
                        Format = format
                    };
                    slideMaster.Load();
                    Slides.Add(slideMaster);
                }
            }
        }
Example #2
0
 protected virtual void ProcessSlideSizeFolder(StorageDirectory sizeFolder, SlideFormatEnum format)
 {
     foreach (var groupFolder in sizeFolder.GetLocalFolders())
     {
         foreach (var slideContentsFolder in groupFolder.GetLocalFolders())
         {
             var slideMaster = new SlideMaster(slideContentsFolder, slideContentsFolder)
             {
                 Group  = groupFolder.Name,
                 Format = format
             };
             slideMaster.Load();
             Slides.Add(slideMaster);
         }
     }
     Slides.Sort(
         (x, y) => x.Group.Equals(y.Group) ? x.Order.CompareTo(y.Order) : WinAPIHelper.StrCmpLogicalW(x.Group, y.Group));
 }