Esempio n. 1
0
        IEnumerable <DirectoryInfo> GetRootFoldersFromDirectory(FolderIconInfo iconInfo)
        {
            //var debug = IsDebug(iconInfo);
            //var allRoots = iconInfo.GetRoots();
            //var folderIconInfo = FolderIconInfo.GetExisting(iconInfo);


            var iconRoots = iconInfo
                            .GetRoots()
                            .Select(x => DirectoriesIO.GetInfo(Directories.Roots.Library, x));
            var roots = new [] { iconInfo.Current }
            .Concat(iconRoots);

            //.ToArray()
            //var strPaths = roots
            //    //.Where(p=>Paths.Exists(p.FullName))
            //    .Select(p => p.FullName)
            //    .ToArray();
            return(roots);
        }
Esempio n. 2
0
        private static IconGenerationResult GetIconGenerationResultFromReference(IconReference icon, double priority = 100, DirectoryInfo directory = null, bool checkIconExists = false)
        {
            if (!icon.Validate(checkIconExists))
            {
                return(null);
            }
            //var debug = string.IsNullOrWhiteSpace(icon.BaseDirectory);
            var baseDirectory = string.IsNullOrWhiteSpace(icon.BaseDirectory)
                ? directory
                : DirectoriesIO.GetInfo(icon.BaseDirectory);

            if (directory == null)
            {
                directory = baseDirectory;
            }
            var root     = new IconGenerationRoot(priority, baseDirectory);
            var source   = new IconGenerationSource(root, root.Priority, baseDirectory);
            var relative = directory.ParseRelativePath(root.Directory);
            var path     = new IconGenerationPath(source, root.Priority, relative);
            var folder   = new IconGenerationFolder(path, root.Priority, relative.Directory);

            return(new IconGenerationResult(folder, root.Priority, icon));
        }