Castle.MonoRail.Framework.EngineContextModule.OnStartMonoRailRequest C# (CSharp) Method

OnStartMonoRailRequest() private method

This method is invoked in response to BeginRequest event. It checks if the request should be treat by MonoRail (by reading the file extension) and if so, creates the IRailsEngineContext instance.
private OnStartMonoRailRequest ( object sender, EventArgs e ) : void
sender object The HttpApplication instance
e System.EventArgs Event information
return void
		private void OnStartMonoRailRequest(object sender, EventArgs e)
		{
			HttpApplication app = (HttpApplication) sender;

			// Is this request a MonoRail request?
			if (!container.IsMonoRailRequest(app.Context.Request.FilePath))
			{
				return;
			}

			// Mark it so we dont have to check the file extension again
			MarkRequestAsMonoRailRequest(app.Context);

			// Creates the our context
			IRailsEngineContext context = CreateRailsEngineContext(app.Context);

			#region TestSupport related

			String isTest = context.Request.Headers["IsTestWorkerRequest"];
			
			if ("true" == isTest)
			{
				Castle.MonoRail.Framework.Internal.Test.TestContextHolder.SetContext(app.Context);
			}

			#endregion
		}