Ejemplo 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);
        }
Ejemplo n.º 2
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;
        }