/// <summary>
        /// 增加 Web 请求代理辅助器。
        /// </summary>
        /// <param name="webRequestAgentHelper">要增加的 Web 请求代理辅助器。</param>
        public void AddWebRequestAgentHelper(IWebRequestAgentHelper webRequestAgentHelper)
        {
            WebRequestAgent agent = new WebRequestAgent(webRequestAgentHelper);

            agent.WebRequestAgentStart   += OnWebRequestAgentStart;
            agent.WebRequestAgentSuccess += OnWebRequestAgentSuccess;
            agent.WebRequestAgentFailure += OnWebRequestAgentFailure;

            m_TaskPool.AddAgent(agent);
        }
Beispiel #2
0
        /// <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;
            agent.DownloadAgentProgress += OnDownloadAgentProgressChanged;
            m_TaskPool.AddAgent(agent);
        }