private void OnWorkerCompleted(object sender, StreamCopyCompleteEventArgs eventArgs) { try { OnDownloadCompleted(downloadWebClient, new AsyncCompletedEventArgs(eventArgs.Exception, eventArgs.CompleteState == CompletedState.Canceled, null)); } finally { worker.ProgressChanged -= OnWorkerProgressChanged; worker.Completed -= OnWorkerCompleted; worker.Dispose(); } }
private void OnCompleted(StreamCopyCompleteEventArgs args) { Completed.SafeInvoke(this, args); }