Esempio n. 1
0
        /// <summary>
        /// Adds a handler for a status code to the list of handlers.
        /// </summary>
        /// <param name="statusCode">The status code which should be handled separately.</param>
        /// <param name="handler">The delegate to your handler.</param>
        /// <returns>The current instance.</returns>
        public AjaxRequestOptions AddStatusCodeHandler(HttpStatusCode statusCode, AjaxResponseHandler handler)
        {
            if (statusCodes.ContainsKey(statusCode))
            {
                statusCodes[statusCode] = handler;
            }
            else
            {
                statusCodes.Add(statusCode, handler);
            }

            return(this);
        }
        /// <summary>
        /// Adds a handler for a status code to the list of handlers.
        /// </summary>
        /// <param name="statusCode">The status code which should be handled separately.</param>
        /// <param name="handler">The delegate to your handler.</param>
        /// <returns>The current instance.</returns>
        public AjaxRequestOptions AddStatusCodeHandler(HttpStatusCode statusCode, AjaxResponseHandler handler)
        {
            if (statusCodes.ContainsKey(statusCode))
                statusCodes[statusCode] = handler;
            else
                statusCodes.Add(statusCode, handler);

            return this;
        }