Exemplo n.º 1
0
 /// <summary>
 /// 销毁对象,会停止所有的下载
 /// </summary>
 public void Dispose()
 {
     if (null != _client)
     {
         _client.CancelAsync();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 销毁对象,会停止所有的下载
 /// </summary>
 public void Dispose()
 {
     if (_client != null)
     {
         _client.DownloadProgressChanged -= OnDownloadProgressChanged;
         _client.DownloadFileCompleted   -= OnDownloadFileCompleted;
         _client.CancelAsync();
         _client.Dispose();
         _client = null;
         if (false == _isDone)
         {
             SetError("Canceled");
             _isDone = true;
         }
     }
 }