Exemple #1
0
        private void Scan()
        {
            int addedpackages = 0;
            int foundpackages = 0;

            Console.WriteLine("Scan initialisé...");
            List <Package> AllPackages = new List <Package>();

            foreach (ScanDir path in ListDirectories)
            {
                HashSet <string> newPackageNames = new HashSet <string>(PackageScan.StyFromDir((path.Path)));
                foreach (string packageName in newPackageNames)
                {
                    Package newPackage = Package.newPackage();
                    newPackage.Nom = packageName;
                    AllPackages.Add(newPackage);
                }
            }

            foreach (Package newPackage in AllPackages)
            {
                foundpackages++;
                if (!ListPackages.Any(p => p.Nom == newPackage.Nom))
                {
                    Console.WriteLine("Adding package " + newPackage.Nom);
                    ListPackages.Add(newPackage);
                    addedpackages++;
                }
            }
            Console.WriteLine("Scan terminé.\n" + foundpackages + " packages trouvés.\n" + addedpackages + " packages ajoutés");
            SaveDB();
        }
        public PackageManagerControl(IServiceContainer services)
        {
            InitializeComponent();
            ListPackages.Initialize(services);

            var infoBar = services.GetService <IInfoBarProvider>().Create(InfoBarControlHost);

            ViewModel = new RPackageManagerViewModel(services, infoBar);

            var searchControlProvider = services.GetService <ISearchControlProvider>();
            var searchControlSettings = new SearchControlSettings {
                SearchCategory = SearchCategory,
                MinWidth       = (uint)SearchControlHost.MinWidth,
                MaxWidth       = uint.MaxValue
            };

            _disposable
            .Add(searchControlProvider.Create(SearchControlHost, ViewModel, searchControlSettings))
            .Add(ViewModel);

            DataContext = ViewModel;
        }
Exemple #3
0
 public Package GetPackage(string name)
 {
     return(ListPackages.Find(item => item.Name == name));
 }
Exemple #4
0
 public PackageManagerControl(ICoreShell coreShell)
 {
     InitializeComponent();
     ListPackages.Initialize(coreShell);
 }
 public PackageManagerControl(IServiceContainer services)
 {
     InitializeComponent();
     ListPackages.Initialize(services);
 }