コード例 #1
0
ファイル: Request.cs プロジェクト: artzub/LoggenCSG
        /// <summary>
        /// Executes the request asynchronously, and calls the specified delegate once done.
        /// </summary>
        /// <param name="responseHandler">The method to call once a response has been received.</param>
        public void ExecuteRequestAsync(Action <IAsyncRequestResult> responseHandler)
        {
            // Validate the input.
            var validator = new MethodValidator(Method, Parameters);

            if (validator.ValidateAllParameters() == false)
            {
                throw new InvalidOperationException("Request parameter validation failed for [" + this + "]");
            }

            // Begin a new request and when it is completed being assembled, execute it asynchronously.
            CreateWebRequest((request) =>
            {
                // When the request is completed constructing, execute it.
                var state = new AsyncExecutionState()
                {
                    ResponseHandler = responseHandler,
                    Try             = 1,
                    WaitTime        = RetryInitialWaitTime,
                    CurrentRequest  = request
                };
                InternalBeginExecuteRequest(state);
            });
        }
コード例 #2
0
ファイル: Request.cs プロジェクト: nick0816/LoggenCSG
        /// <summary>
        /// Executes the request asynchronously, and calls the specified delegate once done.
        /// </summary>
        /// <param name="responseHandler">The method to call once a response has been received.</param>
        public void ExecuteRequestAsync(Action<IAsyncRequestResult> responseHandler)
        {
            // Validate the input.
            var validator = new MethodValidator(Method, Parameters);
            if (validator.ValidateAllParameters() == false)
            {
                throw new InvalidOperationException("Request parameter validation failed for [" + this + "]");
            }

            InternalBeginExecuteRequest(new AsyncExecutionState
                                        {
                                            ResponseHandler = responseHandler,
                                            Try = 1,
                                            WaitTime = RetryInitialWaitTime,
                                            CurrentRequest =  CreateWebRequest()
                                        });
        }
コード例 #3
0
ファイル: Request.cs プロジェクト: JANCARLO123/google-apis
        /// <summary>
        /// Executes the request asynchronously, and calls the specified delegate once done.
        /// </summary>
        /// <param name="responseHandler">The method to call once a response has been received.</param>
        public void ExecuteRequestAsync(Action<IAsyncRequestResult> responseHandler)
        {
            // Validate the input.
            var validator = new MethodValidator(Method, Parameters);
            if (validator.ValidateAllParameters() == false)
            {
                throw new InvalidOperationException("Request parameter validation failed for [" + this + "]");
            }

            // Begin a new request and when it is completed being assembled, execute it asynchronously.
            CreateWebRequest((request) =>
            {
                // When the request is completed constructing, execute it.
                var state = new AsyncExecutionState()
                {
                    ResponseHandler = responseHandler,
                    Try = 1,
                    WaitTime = RetryInitialWaitTime,
                    CurrentRequest = request
                };
                InternalBeginExecuteRequest(state);
            });
        }