예제 #1
0
 internal void ReadNextDownloadResult()
 {
     m_streamReadState           = StreamReadState.Response;
     m_streamBytesNeeded         = ResponseLen;
     m_streamBytesRead           = 0;
     m_nextFileCompleteEventArgs = new DownloadFinishedEventArgs {
         Result = DownloadResult.Failure
     };
     BeginReadHeader();
 }
예제 #2
0
        private void OnDownloadFinished(DownloadFinishedEventArgs e)
        {
            m_downloadQueue.Dequeue();
            e.DownloadQueueLength = m_downloadQueue.Count;

            if (DownloadFinished != null)
            {
                DownloadFinished(this, e);
            }

            if (m_downloadQueue.Count > 0)
            {
                ReadNextDownloadResult();
            }
        }
예제 #3
0
        private void OnDownloadFinished(DownloadFinishedEventArgs e)
        {
            m_mutex.WaitOne();
            m_downloadQueue.Dequeue();
            int count = m_downloadQueue.Count;

            m_mutex.ReleaseMutex();

            e.DownloadQueueLength = count;
            if (DownloadFinished != null)
            {
                DownloadFinished(this, e);
            }

            if (count > 0)
            {
                ReadNextDownloadResult();
            }
        }