public async void StartCheck(Manifest mani, Manager mana)
        {
            this.mani = mani;
            this.mana = mana;
            this.controller = await this.ShowProgressAsync("Please wait...", "Initialisation");
            this.controller.SetProgress(0.1);
            this.controller.SetMessage("Aquisition du Manifest");
            await Task.Delay(1000);
            mani.setManifestServer(mana.getManifestServer());
            this.controller.SetMessage("Vérification du contenu locale");
            this.controller.SetProgress(0.3);
            mani.parse();
            this.controller.SetMessage("Comparaison des Dossiers et Fichiers");
            this.controller.SetProgress(0.5);
            mani.check(false);
            this.controller.SetMessage("Chargement des Résultats");
            this.controller.SetProgress(0.8);

            foreach (var item in this.DataGrid.Items)
            {
                this.DataGrid.Items.Remove(item);
            }

            foreach (var item in mani.getDirsToDelete())
            {
                ItemEntry it = new ItemEntry { TypeValue = "DELETE DIR", PathValue = item, ProgressValue = 0, SizeValue = "inconnu" };
                this.DataGrid.Items.Add(it);
                this.populate.Add(item);
            }

            foreach (var item in mani.getDirsToCreate())
            {
                ItemEntry it = new ItemEntry { TypeValue = "CREATE DIR", PathValue = item, ProgressValue = 0, SizeValue = "inconnu" };
                this.DataGrid.Items.Add(it);
                this.populate.Add(item);
            }

            foreach (var item in mani.getFilesToDelete())
            {
                ItemEntry it = new ItemEntry { TypeValue = "DELETE FILE", PathValue = item, ProgressValue = 0, SizeValue = "inconnu" };
                this.DataGrid.Items.Add(it);
                this.populate.Add(item);
            }

            foreach (var item in mani.getFilesToUpdate())
            {
                ItemEntry it = new ItemEntry { TypeValue = "UPDATE FILE", PathValue = item, ProgressValue = 0, SizeValue = "inconnu" };
                this.DataGrid.Items.Add(it);
                this.populate.Add(item);
            }

            foreach (var item in mani.getFilesToDownload())
            {
                ItemEntry it = new ItemEntry { TypeValue = "DOWNLOAD FILE", PathValue = item, ProgressValue = 0, SizeValue = "inconnu" };
                this.DataGrid.Items.Add(it);
                this.populate.Add(item);
            }
            
            await this.controller.CloseAsync();

        }
Пример #2
0
        public void Check()
        {
            RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wow6432Node\bohemia interactive\arma 3");
            String test = (String)rk.GetValue("main");

            this.mani = new Manifest(test + "\\"+this.relativePathRepo, this.ftpUrl, this.basedir, this.ftpUser, this.ftpPassword);
     
            Arma3ModsWindow a3mw = new Arma3ModsWindow();
            a3mw.Show();
            a3mw.StartCheck(mani,this);

        }