publicize 2 events on UmbracoModule
This commit is contained in:
@@ -60,7 +60,7 @@ namespace Umbraco.Web
|
||||
}
|
||||
}
|
||||
|
||||
private void UmbracoModule_EndRequest(object sender, EventArgs e)
|
||||
private void UmbracoModule_EndRequest(object sender, UmbracoRequestEventArgs e)
|
||||
{
|
||||
// will clear the batch - will remain in HttpContext though - that's ok
|
||||
FlushBatch();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Web;
|
||||
using Umbraco.Core.Sync;
|
||||
using Umbraco.Web.Routing;
|
||||
|
||||
namespace Umbraco.Web
|
||||
{
|
||||
@@ -64,7 +65,7 @@ namespace Umbraco.Web
|
||||
return batch;
|
||||
}
|
||||
|
||||
void UmbracoModule_EndRequest(object sender, EventArgs e)
|
||||
void UmbracoModule_EndRequest(object sender, UmbracoRequestEventArgs e)
|
||||
{
|
||||
FlushBatch();
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace Umbraco.Web.Routing
|
||||
/// <summary>
|
||||
/// Represents the outcome of trying to route an incoming request.
|
||||
/// </summary>
|
||||
internal enum EnsureRoutableOutcome
|
||||
public enum EnsureRoutableOutcome
|
||||
{
|
||||
/// <summary>
|
||||
/// Request routes to a document.
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Web.Routing
|
||||
/// <summary>
|
||||
/// Event args containing information about why the request was not routable, or if it is routable
|
||||
/// </summary>
|
||||
internal class RoutableAttemptEventArgs : UmbracoRequestEventArgs
|
||||
public class RoutableAttemptEventArgs : UmbracoRequestEventArgs
|
||||
{
|
||||
public EnsureRoutableOutcome Outcome { get; private set; }
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Umbraco.Web.Routing
|
||||
/// <summary>
|
||||
/// Event args used for event launched during a request (like in the UmbracoModule)
|
||||
/// </summary>
|
||||
internal class UmbracoRequestEventArgs : EventArgs
|
||||
public class UmbracoRequestEventArgs : EventArgs
|
||||
{
|
||||
public UmbracoContext UmbracoContext { get; private set; }
|
||||
public HttpContextBase HttpContext { get; private set; }
|
||||
|
||||
@@ -524,9 +524,9 @@ namespace Umbraco.Web
|
||||
"Total milliseconds for umbraco request to process: {0}", () => DateTime.Now.Subtract(UmbracoContext.Current.ObjectCreated).TotalMilliseconds);
|
||||
}
|
||||
|
||||
OnEndRequest(new EventArgs());
|
||||
OnEndRequest(new UmbracoRequestEventArgs(UmbracoContext.Current, new HttpContextWrapper(httpContext)));
|
||||
|
||||
DisposeHttpContextItems(httpContext);
|
||||
DisposeHttpContextItems(httpContext);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -536,18 +536,19 @@ namespace Umbraco.Web
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
internal static event EventHandler<RoutableAttemptEventArgs> RouteAttempt;
|
||||
|
||||
public static event EventHandler<RoutableAttemptEventArgs> RouteAttempt;
|
||||
private void OnRouteAttempt(RoutableAttemptEventArgs args)
|
||||
{
|
||||
if (RouteAttempt != null)
|
||||
RouteAttempt(this, args);
|
||||
}
|
||||
|
||||
internal static event EventHandler<EventArgs> EndRequest;
|
||||
private void OnEndRequest(EventArgs args)
|
||||
public static event EventHandler<UmbracoRequestEventArgs> EndRequest;
|
||||
private void OnEndRequest(UmbracoRequestEventArgs args)
|
||||
{
|
||||
if (EndRequest != null)
|
||||
EndRequest(this, args);
|
||||
|
||||
Reference in New Issue
Block a user