public IAsyncResult BeginProcessRequest(HttpContext context, AsyncCallback callback, object state)
{
//if (Context is HttpContextWrapper) (Context as HttpContextWrapper).WrappedContext = context;
Arguments[Arguments.Length - 2] = callback;
Arguments[Arguments.Length - 1] = state;
object value = Handler.ExecuteAction(Context, Controller, Arguments);
if (!(value is IAsyncResult))
{
Handler.RenderAction(Context, value);
context.Response.End(); // TODO: How to finish off non Async?
return null;
}
else
return (IAsyncResult)value;
}