Exemplo n.º 1
0
        /// <summary>
        /// 创建 Web 请求代理辅助器完成事件。
        /// </summary>
        /// <param name="webResponseBytes">Web 响应的数据流。</param>
        /// <returns>创建的 Web 请求代理辅助器完成事件。</returns>
        public static WebRequestAgentHelperCompleteEventArgs Create(byte[] webResponseBytes)
        {
            WebRequestAgentHelperCompleteEventArgs webRequestAgentHelperCompleteEventArgs = ReferencePool.Acquire <WebRequestAgentHelperCompleteEventArgs>();

            webRequestAgentHelperCompleteEventArgs.m_WebResponseBytes = webResponseBytes;
            return(webRequestAgentHelperCompleteEventArgs);
        }
Exemplo n.º 2
0
        private void OnWebRequestAgentHelperComplete(object sender, WebRequestAgentHelperCompleteEventArgs e)
        {
            m_Helper.Reset();
            m_Task.Status = WebRequestTaskStatus.Done;

            if (WebRequestAgentSuccess != null)
            {
                WebRequestAgentSuccess(this, e.GetWebResponseBytes());
            }

            m_Task.Done = true;
        }