示例#1
0
        /// <summary>
        /// Will raise the event on the current thread synchronously.
        /// i.e. it will wait until all event handlers have processed the event.
        /// </summary>
        /// <param name="args">The state to be passed to the event.</param>
        private void RaiseOnAfterLogUrlEvent(AfterLogUrlEventArgs args)
        {
            // Make a temporary copy of the event to avoid possibility of
            // a race condition if the last subscriber unsubscribes
            // immediately after the null check and before the event is raised.

            AfterLogUrlEventHandler eventHandler;

            if (!Monitor.TryEnter(afterLogUrlEventLock, lockTimeout))
            {
                throw new ApplicationException("Timeout waiting for lock - RaiseOnAfterLogUrlEvent");
            }
            try
            {
                eventHandler = afterLogUrlEvent;
            }
            finally
            {
                Monitor.Exit(afterLogUrlEventLock);
            }

            OnAfterLogUrlEvent(args);

            if (eventHandler != null)
            {
                eventHandler(this, args);
            }
        }
示例#2
0
        /// <summary>
        /// Raise log url event
        /// </summary>
        /// <param name="httpApplication">The httpApplication the request was raised on.</param>
        /// <param name="expression">The expression that matched the url.</param>
        internal void RaiseLogUrlEvent(HttpApplication httpApplication, string expression)
        {
            var beforeLogUrlEventArgs = new BeforeLogUrlEventArgs(httpApplication, expression);

            RaiseOnBeforeLogUrlEvent(beforeLogUrlEventArgs);

            if (beforeLogUrlEventArgs.Cancel)
            {
                return;
            }

            var logUrlEventArgs = new LogUrlEventArgs(httpApplication, expression);

            RaiseOnLogUrlEvent(logUrlEventArgs);

            var afterLogUrlEventArgs = new AfterLogUrlEventArgs(httpApplication, expression);

            RaiseOnAfterLogUrlEvent(afterLogUrlEventArgs);
        }
示例#3
0
 /// <summary>
 /// Will raise the event on the calling thread asynchronously.
 /// i.e. it will immediatly continue processing even though event
 /// handlers have not processed the event yet.
 /// </summary>
 /// <param name="args">The state to be passed to the event.</param>
 private void RaiseAsynchronousOnAfterLogUrlEvent(AfterLogUrlEventArgs args)
 {
     asyncOperation.Post(new SendOrPostCallback(AsynchronousOnAfterLogUrlEventRaised), args);
 }
示例#4
0
 private void OnAfterLogUrlEvent(AfterLogUrlEventArgs e)
 {
     // TODO: Implement default behaviour of OnAfterLogUrlEvent
 }
示例#5
0
 /// <summary>
 /// Will raise the event on the calling thread synchronously.
 /// i.e. it will wait until all event handlers have processed the event.
 /// </summary>
 /// <param name="args">The state to be passed to the event.</param>
 private void RaiseCrossThreadOnAfterLogUrlEvent(AfterLogUrlEventArgs args)
 {
     asyncOperation.SynchronizationContext.Send(new SendOrPostCallback(AsynchronousOnAfterLogUrlEventRaised), args);
 }
示例#6
0
        /// <summary>
        /// Raise log url event
        /// </summary>
        /// <param name="httpApplication">The httpApplication the request was raised on.</param>
        /// <param name="expression">The expression that matched the url.</param>
        private void RaiseLogUrlEvent(HttpApplication httpApplication, string expression)
        {
            var beforeLogUrlEventArgs = new BeforeLogUrlEventArgs(httpApplication, expression);
            RaiseOnBeforeLogUrlEvent(beforeLogUrlEventArgs);

            if (beforeLogUrlEventArgs.Cancel) return;

            var logUrlEventArgs = new LogUrlEventArgs(httpApplication, expression);
            RaiseOnLogUrlEvent(logUrlEventArgs);

            var afterLogUrlEventArgs = new AfterLogUrlEventArgs(httpApplication, expression);
            RaiseOnAfterLogUrlEvent(afterLogUrlEventArgs);
        }
示例#7
0
        /// <summary>
        /// Will raise the event on the current thread synchronously.
        /// i.e. it will wait until all event handlers have processed the event.
        /// </summary>
        /// <param name="args">The state to be passed to the event.</param>
        private void RaiseOnAfterLogUrlEvent(AfterLogUrlEventArgs args)
        {
            // Make a temporary copy of the event to avoid possibility of
            // a race condition if the last subscriber unsubscribes
            // immediately after the null check and before the event is raised.

            AfterLogUrlEventHandler eventHandler;

            if (!Monitor.TryEnter(afterLogUrlEventLock, _lockTimeout))
            {
                throw new ApplicationException("Timeout waiting for lock - RaiseOnAfterLogUrlEvent");
            }
            try
            {
                eventHandler = afterLogUrlEvent;
            }
            finally
            {
                Monitor.Exit(afterLogUrlEventLock);
            }

            OnAfterLogUrlEvent(args);

            if (eventHandler != null)
            {
                eventHandler(this, args);
            }
        }
示例#8
0
 /// <summary>
 /// Will raise the event on the calling thread asynchronously. 
 /// i.e. it will immediatly continue processing even though event 
 /// handlers have not processed the event yet.
 /// </summary>
 /// <param name="args">The state to be passed to the event.</param>
 private void RaiseAsynchronousOnAfterLogUrlEvent(AfterLogUrlEventArgs args)
 {
     _asyncOperation.Post(new SendOrPostCallback(AsynchronousOnAfterLogUrlEventRaised), args);
 }
示例#9
0
 /// <summary>
 /// Will raise the event on the calling thread synchronously. 
 /// i.e. it will wait until all event handlers have processed the event.
 /// </summary>
 /// <param name="args">The state to be passed to the event.</param>
 private void RaiseCrossThreadOnAfterLogUrlEvent(AfterLogUrlEventArgs args)
 {
     _asyncOperation.SynchronizationContext.Send(new SendOrPostCallback(AsynchronousOnAfterLogUrlEventRaised), args);
 }
示例#10
0
 private void OnAfterLogUrlEvent(AfterLogUrlEventArgs e)
 {
     // TODO: Implement default behaviour of OnAfterLogUrlEvent
 }