public void Install() { if (InstallPackages.Count > 0) { InstallPackage installPackage = InstallPackages.Dequeue(); installPackage.SetEventOnFinished((_installPackage) => { InstallPackage iinstallPackage = _installPackage as InstallPackage; if (iinstallPackage.IsSucess) { if (InstallPackages.Count > 0) { Install(); } else { IsSucess = true; App.MainThread.Post(OnFinished, this); } } else { IsSucess = false; InstallPackages.Clear(); App.MainThread.Post(OnFinished, this); } }); } }
public Installer(string[] packagePathes) { InstallPackages = new Queue <InstallPackage>(); for (int i = 0; i < packagePathes.Length; i++) { string pathes = packagePathes[i]; InstallPackage installPackage = new InstallPackage(pathes); InstallPackages.Enqueue(installPackage); } }