Ejemplo n.º 1
0
        /// <summary>
        /// Called when a HTTP request begins.
        /// </summary>
        /// <param name="s">The sender (<see cref="HttpApplication"/>).</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        public void OnBeginRequest(Object s, EventArgs e)
        {
            HttpApplication        app = (HttpApplication)s;
            ServicePointMapElement ele = _map.GetBestMatch(app.Request.Url.PathAndQuery, app.Request.HttpMethod);

            Logger.General.Debug("Request received for: " + app.Request.Url.ToString());

            if (ele != null)
            {
                Logger.General.Debug("Handler method found: " + ele.MethodInfo.Name);
                ele.MethodInfo.Invoke(_handler, new object[] { app });
            }
            else
            {
                Logger.General.Debug("No handler method was found for " + app.Request.Url.ToString());
            }
        }