コード例 #1
0
 private void downloadStarted(DownloadStartedEventArgs args)
 {
     lock (this.monitor)
     {
         this.OpenFileIfNecessary();
     }
 }
コード例 #2
0
 protected virtual void OnDownloadStarted(DownloadStartedEventArgs args)
 {
     if (this.DownloadStarted != null)
     {
         this.DownloadStarted(args);
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: Haceau-Zoac/Downloader
 private static void OnDownloadStarted(object sender, DownloadStartedEventArgs e)
 {
     AverageSpeed?.Clear();
     ConsoleProgress =
         new ProgressBar(10000, $"Downloading {Path.GetFileName(e.FileName)} ...", ProcessBarOption);
     ChildConsoleProgresses = new ConcurrentDictionary <string, ChildProgressBar>();
 }
コード例 #4
0
        private async void Updater_DownloadingStarted(object sender, DownloadStartedEventArgs e)
        {
            progressDialog = await MainWindow.ShowProgressAsync($"Downloading update - {e.Version}", "Estimated time left: 0 sec (0 kB of 0 kB downloaded)\n" +
                                                                "Time spent: 0 sec");

            progressDialog.Minimum = 0;
            progressDialog.Maximum = 100;
        }
コード例 #5
0
 private void OnDownloadStarted(DownloadStartedEventArgs args)
 {
     lock (this.monitor)
     {
         this.downloadSizes[args.Download]          = args.CheckResult.Size;
         this.alreadyDownloadedSizes[args.Download] = args.AlreadyDownloadedSize;
     }
 }
コード例 #6
0
        } // SegmentDownloadCompleted

        #endregion

        #region OnEvent() methods

        protected virtual void OnDownloadStarted(object sender, DownloadStartedEventArgs e)
        {
            if (DownloadStarted == null)
            {
                return;
            }

            DownloadStarted(sender, e);
        } // OnDownloadStarted
コード例 #7
0
        }     // DvbStpEnhancedClient.SegmentDownloadCompletedEventArgs

        #endregion

        #region FireEvent() methods

        protected virtual void FireDownloadStarted()
        {
            if (DownloadStarted == null)
            {
                return;
            }

            var e = new DownloadStartedEventArgs()
            {
                SegmentsCount = this.Payloads.Count
            };

            OnDownloadStarted(this, e);
        } // FireDownloadStarted
コード例 #8
0
 void Download_DownloadStarted(object sender, DownloadStartedEventArgs args)
 {
     if (MessageBox.Show("Download file " + args.SuggestedFileName + "?", "Download", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         size        = args.FileSize;
         label1.Text = args.SuggestedFileName;
         this.Text   = "Download " + args.SuggestedFileName;
         label2.Text = "0";
         this.Show();
     }
     else
     {
         Download.Cancel();
         this.Close();
     }
 }
コード例 #9
0
        /// <summary>
        /// Method used to handle the event.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">The task information.</param>
        private void OnDownloadStarted(object sender, TaskEventArgs e)
        {
            if (e.Task != null)
            {
                e.Task.State = DownloadTaskState.Downloading;
                DownloadRegistryManager.Current.UpdateTask(e.Task);

                if (DownloadStarted != null)
                {
                    var eventArgs = new DownloadStartedEventArgs(e.Task.DownloadItem);
                    DownloadStarted(this, eventArgs);
                    if (eventArgs.Cancel)
                    {
                        CancelDownload(eventArgs.DownloadItem);
                    }
                }
            }
        }
コード例 #10
0
        private void downloadStarted(DownloadStartedEventArgs args)
        {
            var  download = args.Download;
            bool shouldNotifyDownloadStarted = false;

            lock (this.monitor)
            {
                if (download == this.currentDownload)
                {
                    if (!this.downloadStartedNotified)
                    {
                        shouldNotifyDownloadStarted  = true;
                        this.downloadStartedNotified = true;
                    }
                }
            }

            if (shouldNotifyDownloadStarted)
            {
                this.OnDownloadStarted(new DownloadStartedEventArgs(this, args.CheckResult, args.AlreadyDownloadedSize));
            }
        }
コード例 #11
0
 private void OnDownloadStarted(object sender, DownloadStartedEventArgs e)
 {
     Model.FilePath = e.FileName;
     Dispatcher.Invoke(DelegateCommandBase.InvalidateRequerySuggested);
 }
コード例 #12
0
ファイル: UpdaterForm.cs プロジェクト: gipasoft/Sfera
 private void updater_DownloadStarted(object sender, DownloadStartedEventArgs e)
 {
     //UpdateList("Inizio aggiornamento del manifest: " + e.Manifest.ManifestId);
     //filesProgressBar.Maximum = e.Manifest.Files.Count;
 }
コード例 #13
0
        } // SegmentDownloadCompleted

        #endregion

        #region OnEvent() methods

        protected virtual void OnDownloadStarted(object sender, DownloadStartedEventArgs e)
        {
            DownloadStarted?.Invoke(sender, e);
        } // OnDownloadStarted