private void OnDownloadAgentSuccess(DownloadAgent sender, int lastDownloadedLength)
 {
     if (m_DownloadSuccessEventHandler != null)
     {
         m_DownloadSuccessEventHandler(this, new DownloadSuccessEventArgs(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, sender.CurrentLength, sender.Task.UserData));
     }
 }
Beispiel #2
0
        public void AddDownloadAgentHelper(IDownloadAgentHelper downlodAgentHeler)
        {
            DownloadAgent agent = new DownloadAgent(AddDownloadAgentHelper);

            agent.DownloadAgentStart += OnDownlodAgentStart;
            m_TaskPool.AddAgent(agent);
        }
Beispiel #3
0
 private void OnDownloadAgentFailure(DownloadAgent sender, string errorMessage)
 {
     if (m_DownloadFailureEventHandler != null)
     {
         m_DownloadFailureEventHandler(this, new DownloadFailureEventArgs(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, errorMessage, sender.Task.UserData));
     }
 }
Beispiel #4
0
 private void OnDownloadAgentStart(DownloadAgent sender)
 {
     if (m_DownloadStartEventHandler != null)
     {
         m_DownloadStartEventHandler(this, new DownloadStartEventArgs(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, sender.CurrentLength, sender.Task.UserData));
     }
 }
Beispiel #5
0
 void OnDownloadAgentStart(DownloadAgent sender)
 {
     if (m_DownloadStartEventHandler != null)
     {
         m_DownloadStartEventHandler(this, new DownloadStartEventArgs(sender.Task.SerialId));
     }
 }
Beispiel #6
0
 private void OnDownloadAgentUpdate(DownloadAgent sender, int lastDownloadedLength)
 {
     m_DownloadCounter.RecordDownloadedLength(lastDownloadedLength);
     if (m_DownloadUpdateEventHandler != null)
     {
         m_DownloadUpdateEventHandler(this, new DownloadUpdateEventArgs(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, sender.CurrentLength, sender.Task.UserData));
     }
 }
Beispiel #7
0
 void OnDownloadAgentUpdate(DownloadAgent sender, int lastDownloadedLength)
 {
     m_DownloadCounter.RecordDownloadedLength(lastDownloadedLength);
     if (m_DownloadUpdateEventHandler != null)
     {
         m_DownloadUpdateEventHandler(this, new DownloadUpdateEventArgs(sender.Task.SerialId));
     }
 }
Beispiel #8
0
        void AddDownloadAgentHelper(IDownloadAgentHelper downloadAgentHelper)
        {
            DownloadAgent agent = new DownloadAgent(downloadAgentHelper);
            agent.DownloadAgentStart += OnDownloadAgentStart;         
            agent.DownloadAgentUpdate += OnDownloadAgentUpdate;

            m_TaskPool.AddAgent(agent);
        }
 private void OnDownloadAgentFailure(DownloadAgent sender, string errorMessage)
 {
     if (m_DownloadFailureEventHandler != null)
     {
         DownloadFailureEventArgs downloadFailureEventArgs = DownloadFailureEventArgs.Create(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, errorMessage, sender.Task.UserData);
         m_DownloadFailureEventHandler(this, downloadFailureEventArgs);
         ReferencePool.Release(downloadFailureEventArgs);
     }
 }
 private void OnDownloadAgentSuccess(DownloadAgent sender, int lastDownloadedLength)
 {
     if (m_DownloadSuccessEventHandler != null)
     {
         DownloadSuccessEventArgs downloadSuccessEventArgs = DownloadSuccessEventArgs.Create(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, sender.CurrentLength, sender.Task.UserData);
         m_DownloadSuccessEventHandler(this, downloadSuccessEventArgs);
         ReferencePool.Release(downloadSuccessEventArgs);
     }
 }
 private void OnDownloadAgentUpdate(DownloadAgent sender, int lastDownloadedLength)
 {
     m_DownloadCounter.RecordDownloadedLength(lastDownloadedLength);
     if (m_DownloadUpdateEventHandler != null)
     {
         DownloadUpdateEventArgs downloadUpdateEventArgs = DownloadUpdateEventArgs.Create(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, sender.CurrentLength, sender.Task.UserData);
         m_DownloadUpdateEventHandler(this, downloadUpdateEventArgs);
         ReferencePool.Release(downloadUpdateEventArgs);
     }
 }
        /// <summary>
        /// 增加下载代理辅助器。
        /// </summary>
        /// <param name="downloadAgentHelper">要增加的下载代理辅助器。</param>
        public void AddDownloadAgentHelper(IDownloadAgentHelper downloadAgentHelper)
        {
            DownloadAgent agent = new DownloadAgent(downloadAgentHelper);
            agent.DownloadAgentStart += OnDownloadAgentStart;
            agent.DownloadAgentUpdate += OnDownloadAgentUpdate;
            agent.DownloadAgentSuccess += OnDownloadAgentSuccess;
            agent.DownloadAgentFailure += OnDownloadAgentFailure;

            m_TaskPool.AddAgent(agent);
        }
Beispiel #13
0
 private void OnDownloadAgentStart(DownloadAgent sender)
 {
     m_DownloadStartEventHandler(this, new DownloadStartEventArgs(sender.Task.SerialId, sender.Task.DownloaPath; ))
 }
 private void OnDownloadAgentSuccess(DownloadAgent sender, int lastDownloadedLength)
 {
     m_DownloadCounter.RecordDownloadedLength(lastDownloadedLength);
     m_DownloadSuccessEventHandler?.Invoke(this, new DownloadSuccessEventArgs(sender.Task.SerialId, sender.Task.DownloadPath, sender.Task.DownloadUri, sender.CurrentLength, sender.Task.UserData));
 }