예제 #1
0
        private void DownloadItem(AbstractMasterClass _item)
        {
            var WebDownloader = new WebClient();

            WebDownloader.DownloadFileCompleted   += (sender, e) => WebDownloader_DownloadFileCompleted(sender, e, _item);
            WebDownloader.DownloadProgressChanged += (sender, e) => WebDownloader_DownloadProgressChanged(sender, e, _item);
            WebDownloader.DownloadFileAsync(new Uri(_item.link), _item.file);
        }
 internal void Extract(AbstractMasterClass item)
 {
     item.proBar.Visibility = Visibility.Hidden;
     item.statusTxb.Text    = "Downloaded"; item.downloaded = true;
     if (infoTxb.Text.Contains("Framework"))
     {
         return;
     }
     item.statusTxb.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new MetodsDelegate(() =>
     {
         using (var p = new Process())
         {
             var si = new ProcessStartInfo()
             {
                 FileName        = file,
                 Arguments       = extractArgument,
                 UseShellExecute = false
             };
             p.StartInfo = si; p.Start(); p.WaitForExit();
         }
     }
                                                                                         ));
 }
예제 #3
0
 private void WebDownloader_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e, AbstractMasterClass item)
 {
 }
예제 #4
0
 private void WebDownloader_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e, AbstractMasterClass item)
 {
     item.proBar.Value = e.ProgressPercentage;
 }