Exemplo n.º 1
0
        public static void InstallPackage(PackageInstall package)
        {
            var client = new WebClient();

            foreach (var download in package.Downloads)
            {
                client.DownloadFile(download.DownloadUrl,
                                    Path.Combine(Minecraft.DotMinecraft, download.DestinationPath));
            }
        }
Exemplo n.º 2
0
 private void UpdatePackageAsync(PackageInstall package)
 {
     if (this.InvokeRequired)
         this.Invoke(new Action(() => UpdatePackageAsync(package)));
     else
     {
         PackageInstall = package;
         installButton.Enabled = true;
         progressBar.Style = ProgressBarStyle.Continuous;
         webKitBrowser.DocumentText = FormatHtml(package.PrimaryItem.DescriptionHtml);
         imagePictureBox.ImageLocation = "http://www.slreposervice.com" + package.PrimaryItem.ImageUrl;
         packageNameLabel.Text = "Install " + package.PrimaryItem.Name;
         packageVersionLabel.Text = "Version " + package.PrimaryItem.FriendlyVersion;
         dependencyListBox.Items.Clear();
         foreach (var item in package.Items)
             dependencyListBox.Items.Add(item.Name);
     }
 }