Esempio n. 1
0
        public ManualResetEvent GetAsync(Action <ICsqWebResponse> callback)
        {
            HttpWebRequest request     = GetWebRequest();
            var            requestInfo = new AsyncWebRequest(request);

            requestInfo.Id       = Id;
            requestInfo.Callback = callback;

            return(requestInfo.GetAsync());
        }
Esempio n. 2
0
        /// <summary>
        /// Initiates an asynchronous GET request from an IHttpWebRequest object.
        /// </summary>
        ///
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="success">
        /// A delegate that will be invoked with the response data structure upon successful resolution
        /// of the request.
        /// </param>
        /// <param name="fail">
        /// A delegate that will be invoked with the response data structure upon failure.
        /// </param>
        ///
        /// <returns>
        /// A ManualResetEvent object for this asynchronous operation.
        /// </returns>

        public ManualResetEvent GetAsync(IHttpWebRequest request, Action <ICsqWebResponse> success, Action <ICsqWebResponse> fail)
        {
            var requestInfo = new AsyncWebRequest(request);

            // do not apply options when using this method.

            requestInfo.Id = Id;
            requestInfo.CallbackSuccess = success;
            requestInfo.CallbackFail    = fail;

            return(requestInfo.GetAsync());
        }
Esempio n. 3
0
        /// <summary>
        /// Initiates an asynchronous GET request.
        /// </summary>
        ///
        /// <param name="success">
        /// A delegate that will be invoked with the response data structure upon successful resolution
        /// of the request.
        /// </param>
        /// <param name="fail">
        /// A delegate that will be invoked with the response data structure upon failure.
        /// </param>
        ///
        /// <returns>
        /// A ManualResetEvent object for this asynchronous operation.
        /// </returns>

        public ManualResetEvent GetAsync(Action <ICsqWebResponse> success, Action <ICsqWebResponse> fail)
        {
            HttpWebRequest request     = GetWebRequest();
            var            requestInfo = new AsyncWebRequest(request);

            requestInfo.Timeout         = Timeout;
            requestInfo.UserAgent       = UserAgent;
            requestInfo.Id              = Id;
            requestInfo.CallbackSuccess = success;
            requestInfo.CallbackFail    = fail;

            return(requestInfo.GetAsync());
        }
Esempio n. 4
0
        /// <summary>
        /// Initiates an asynchronous GET request.
        /// </summary>
        ///
        /// <param name="success">
        /// A delegate that will be invoked with the response data structure upon successful resolution
        /// of the request.
        /// </param>
        /// <param name="fail">
        /// A delegate that will be invoked with the response data structure upon failure.
        /// </param>
        ///
        /// <returns>
        /// A ManualResetEvent object for this asynchronous operation.
        /// </returns>

        public ManualResetEvent GetAsync(Action<ICsqWebResponse> success, Action<ICsqWebResponse> fail)
        {
            IHttpWebRequest request = GetWebRequest();
            var requestInfo = new AsyncWebRequest(request);
            requestInfo.Timeout = Timeout;
            requestInfo.UserAgent = UserAgent;
            requestInfo.Id = Id;
            requestInfo.CallbackSuccess  = success;
            requestInfo.CallbackFail = fail;

            return requestInfo.GetAsync();
        }
        public ManualResetEvent GetAsync(Action<ICsqWebResponse> callback)
        {
            HttpWebRequest request = GetWebRequest();
            var requestInfo = new AsyncWebRequest(request);
            requestInfo.Id = Id;
            requestInfo.Callback = callback;

            return requestInfo.GetAsync();
        }
Esempio n. 6
0
        /// <summary>
        /// Initiates an asynchronous GET request from an IHttpWebRequest object.
        /// </summary>
        ///
        /// <param name="request">
        /// The request.
        /// </param>
        /// <param name="success">
        /// A delegate that will be invoked with the response data structure upon successful resolution
        /// of the request.
        /// </param>
        /// <param name="fail">
        /// A delegate that will be invoked with the response data structure upon failure.
        /// </param>
        ///
        /// <returns>
        /// A ManualResetEvent object for this asynchronous operation.
        /// </returns>

        public ManualResetEvent GetAsync(IHttpWebRequest request, Action<ICsqWebResponse> success, Action<ICsqWebResponse> fail)
        {
            var requestInfo = new AsyncWebRequest(request);
            // do not apply options when using this method.

            requestInfo.Id = Id;
            requestInfo.CallbackSuccess = success;
            requestInfo.CallbackFail = fail;

            return requestInfo.GetAsync();
        }