Beispiel #1
0
        void client_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
        {
            // NOTE: Fixes bug #2021741 - Application Hangs
            // =============================================
            // Ensure the timer is stopped whenever a download
            // is completed.
            lock (_LockObject)
            {
                StopTimer();
            }

            log.Info("Download of '" + DestinationName + "' completed.");
            if (e.Cancelled)
            {
                OnCancelled();
            }
            else if (e.Error != null)
            {
                OnError(e.Error);
            }
            else
            {
                DownloadData = e.Result;

                if (_UpdateNotifier != null)
                {
                    _UpdateNotifier.EndFileDownload(DownloadUri, Size);
                }

                OnCompleted();
            }
        }