Ejemplo n.º 1
0
 private void DownloadImage(List <CoverInfo> coverInfos)
 {
     _bitmapImages.Clear();
     _webClients = new Dictionary <HttpWebClient, int>();
     for (int i = 0; i < coverInfos.Count; i++)
     {
         _bitmapImages.Add(new BitmapImage());
     }
     _count      = coverInfos.Count;
     _markCount  = 0;
     _coverInfos = coverInfos;
     for (int m = 0; m < coverInfos.Count; m++)
     {
         HttpWebClient _clientByImage = new HttpWebClient();//图片异步下载
         _clientByImage.OpenReadCompleted += new OpenReadCompletedEventHandler(_clientByImage_OpenReadCompleted);
         _clientByImage.OpenReadAsync(coverInfos[m].CoverImgUrl);
         _webClients.Add(_clientByImage, m);
     }
 }
Ejemplo n.º 2
0
 private void DownloadImage(List<CoverInfo> coverInfos)
 {
     _bitmapImages.Clear();
     _webClients = new Dictionary<HttpWebClient, int>();
     for (int i = 0; i < coverInfos.Count; i++)
     {
         _bitmapImages.Add(new BitmapImage());
     }
     _count = coverInfos.Count;
     _markCount = 0;
     _coverInfos = coverInfos;
     for (int m = 0; m < coverInfos.Count; m++)
     {
         HttpWebClient _clientByImage = new HttpWebClient();//图片异步下载
         _clientByImage.OpenReadCompleted += new OpenReadCompletedEventHandler(_clientByImage_OpenReadCompleted);
         _clientByImage.OpenReadAsync(coverInfos[m].CoverImgUrl);
         _webClients.Add(_clientByImage, m);
     }
 }