internal static void EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
        {
            if (!_theApplicationFactory._appOnStartCalled)
            {
                Exception error = null;
                lock (_theApplicationFactory) {
                    if (!_theApplicationFactory._appOnStartCalled)
                    {
                        using (new DisposableHttpContextWrapper(context)) {
                            // impersonation could be required (UNC share or app credentials)

                            WebBaseEvent.RaiseSystemEvent(_theApplicationFactory, WebEventCodes.ApplicationStart);

                            if (_theApplicationFactory._onStartMethod != null)
                            {
                                app.ProcessSpecialRequest(context,
                                                          _theApplicationFactory._onStartMethod,
                                                          _theApplicationFactory._onStartParamCount,
                                                          _theApplicationFactory,
                                                          EventArgs.Empty,
                                                          null);
                            }
                        }
                    }

                    _theApplicationFactory._appOnStartCalled = true;
                    error = context.Error;
                }
                if (error != null)
                {
                    throw new HttpException(error.Message, error);
                }
            }
        }
        private void FireSessionOnEnd(HttpSessionState session, Object eventSource, EventArgs eventArgs)
        {
            if (_sessionOnEndMethod != null)
            {
                HttpApplication app = GetSpecialApplicationInstance();
#if !FEATURE_PAL // FEATURE_PAL does not enable COM
                if (AspCompatApplicationStep.AnyStaObjectsInSessionState(session) || HttpRuntime.ApartmentThreading)
                {
                    AspCompatSessionOnEndHelper helper = new AspCompatSessionOnEndHelper(app, session, eventSource, eventArgs);

                    AspCompatApplicationStep.RaiseAspCompatEvent(
                        null,
                        app,
                        session.SessionID,
                        _sessionOnEndEventHandlerAspCompatHelper,
                        helper,
                        EventArgs.Empty);
                }
                else
                {
#endif // !FEATURE_PAL
                app.ProcessSpecialRequest(
                    null,
                    _sessionOnEndMethod,
                    _sessionOnEndParamCount,
                    eventSource,
                    eventArgs,
                    session);
#if !FEATURE_PAL // FEATURE_PAL does not enable COM
            }
#endif // !FEATURE_PAL

                RecycleSpecialApplicationInstance(app);
            }
        }
示例#3
0
 internal static void EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
 {
     if (!_theApplicationFactory._appOnStartCalled)
     {
         Exception innerException = null;
         lock (_theApplicationFactory)
         {
             if (!_theApplicationFactory._appOnStartCalled)
             {
                 using (new DisposableHttpContextWrapper(context))
                 {
                     WebBaseEvent.RaiseSystemEvent(_theApplicationFactory, 0x3e9);
                     if (_theApplicationFactory._onStartMethod != null)
                     {
                         app.ProcessSpecialRequest(context, _theApplicationFactory._onStartMethod, _theApplicationFactory._onStartParamCount, _theApplicationFactory, EventArgs.Empty, null);
                     }
                 }
             }
             _theApplicationFactory._appOnStartCalled = true;
             innerException = context.Error;
         }
         if (innerException != null)
         {
             throw new HttpException(innerException.Message, innerException);
         }
     }
 }
示例#4
0
 private void FireApplicationOnStart(HttpContext context)
 {
     if (this._onStartMethod != null)
     {
         HttpApplication specialApplicationInstance = this.GetSpecialApplicationInstance();
         specialApplicationInstance.ProcessSpecialRequest(context, this._onStartMethod, this._onStartParamCount, this, EventArgs.Empty, null);
         this.RecycleSpecialApplicationInstance(specialApplicationInstance);
     }
 }
示例#5
0
 private void FireApplicationOnEnd()
 {
     if (this._onEndMethod != null)
     {
         HttpApplication specialApplicationInstance = this.GetSpecialApplicationInstance();
         specialApplicationInstance.ProcessSpecialRequest(null, this._onEndMethod, this._onEndParamCount, this, EventArgs.Empty, null);
         this.RecycleSpecialApplicationInstance(specialApplicationInstance);
     }
 }
        private void FireApplicationOnEnd()
        {
            if (_onEndMethod != null)
            {
                HttpApplication app = GetSpecialApplicationInstance();

                app.ProcessSpecialRequest(
                    null,
                    _onEndMethod,
                    _onEndParamCount,
                    this,
                    EventArgs.Empty,
                    null);

                RecycleSpecialApplicationInstance(app);
            }
        }
        //
        //  Application on_start / on_end
        //

        private void FireApplicationOnStart(HttpContext context)
        {
            if (_onStartMethod != null)
            {
                HttpApplication app = GetSpecialApplicationInstance();

                app.ProcessSpecialRequest(
                    context,
                    _onStartMethod,
                    _onStartParamCount,
                    this,
                    EventArgs.Empty,
                    null);

                RecycleSpecialApplicationInstance(app);
            }
        }
示例#8
0
        private void FireSessionOnEnd(HttpSessionState session, Object eventSource, EventArgs eventArgs)
        {
            if (_sessionOnEndMethod != null)
            {
                HttpApplication app = GetSpecialApplicationInstance();

                app.ProcessSpecialRequest(
                    null,
                    _sessionOnEndMethod,
                    _sessionOnEndParamCount,
                    eventSource,
                    eventArgs,
                    session);

                RecycleSpecialApplicationInstance(app);
            }
        }
示例#9
0
 private void FireSessionOnEnd(HttpSessionState session, object eventSource, EventArgs eventArgs)
 {
     if (this._sessionOnEndMethod != null)
     {
         HttpApplication specialApplicationInstance = this.GetSpecialApplicationInstance();
         if (AspCompatApplicationStep.AnyStaObjectsInSessionState(session) || HttpRuntime.ApartmentThreading)
         {
             AspCompatSessionOnEndHelper source = new AspCompatSessionOnEndHelper(specialApplicationInstance, session, eventSource, eventArgs);
             AspCompatApplicationStep.RaiseAspCompatEvent(null, specialApplicationInstance, session.SessionID, this._sessionOnEndEventHandlerAspCompatHelper, source, EventArgs.Empty);
         }
         else
         {
             specialApplicationInstance.ProcessSpecialRequest(null, this._sessionOnEndMethod, this._sessionOnEndParamCount, eventSource, eventArgs, session);
         }
         this.RecycleSpecialApplicationInstance(specialApplicationInstance);
     }
 }
 internal static void EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app)
 {
     if (!_theApplicationFactory._appOnStartCalled)
     {
         Exception innerException = null;
         lock (_theApplicationFactory)
         {
             if (!_theApplicationFactory._appOnStartCalled)
             {
                 using (new DisposableHttpContextWrapper(context))
                 {
                     WebBaseEvent.RaiseSystemEvent(_theApplicationFactory, 0x3e9);
                     if (_theApplicationFactory._onStartMethod != null)
                     {
                         app.ProcessSpecialRequest(context, _theApplicationFactory._onStartMethod, _theApplicationFactory._onStartParamCount, _theApplicationFactory, EventArgs.Empty, null);
                     }
                 }
             }
             _theApplicationFactory._appOnStartCalled = true;
             innerException = context.Error;
         }
         if (innerException != null)
         {
             throw new HttpException(innerException.Message, innerException);
         }
     }
 }
 internal static void EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) {
     if (!_theApplicationFactory._appOnStartCalled) {
         Exception error = null;
         lock (_theApplicationFactory) {
             if (!_theApplicationFactory._appOnStartCalled) {
                 using (new DisposableHttpContextWrapper(context)) {
                     // impersonation could be required (UNC share or app credentials)
                     
                     WebBaseEvent.RaiseSystemEvent(_theApplicationFactory, WebEventCodes.ApplicationStart);
                     
                     if (_theApplicationFactory._onStartMethod != null) {
                         app.ProcessSpecialRequest(context,
                                                   _theApplicationFactory._onStartMethod,
                                                   _theApplicationFactory._onStartParamCount,
                                                   _theApplicationFactory,
                                                   EventArgs.Empty, 
                                                   null);
                     }
                 }
             }
             
             _theApplicationFactory._appOnStartCalled = true;
             error = context.Error;
         }
         if (error != null) {
             throw new HttpException(error.Message, error);
         }
     }
 }