Beispiel #1
0
        public static void DeleteCollection(TextureCollection collection)
        {
            Collections.RemoveAll(x => x == collection);
            var remove = Packages.Where(package => !Collections.Any(x => x.Packages.Contains(package))).ToList();

            foreach (var package in remove)
            {
                Packages.Remove(package);
                package.Provider.DeletePackages(new[] { package });
                package.Dispose();
            }
        }
Beispiel #2
0
        public static TextureCollection CreateCollection(IEnumerable <string> sourceRoots, IEnumerable <string> additionalPackages, IEnumerable <string> blacklist, IEnumerable <string> whitelist)
        {
            var list       = sourceRoots.ToList();
            var additional = additionalPackages == null ? new List <string>() : additionalPackages.ToList();
            var wl         = whitelist == null ? new List <string>() : whitelist.ToList();
            var bl         = blacklist == null ? new List <string>() : blacklist.ToList();
            var pkgs       = new List <TexturePackage>();

            foreach (var provider in RegisteredProviders)
            {
                pkgs.AddRange(provider.CreatePackages(list, additional, bl, wl));
            }
            var tc = new TextureCollection(pkgs);

            Packages.AddRange(pkgs);
            Collections.Add(tc);
            return(tc);
        }