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);
            }
        }
        private void SessionOnEndEventHandlerAspCompatHelper(Object eventSource, EventArgs eventArgs)
        {
            AspCompatSessionOnEndHelper helper = (AspCompatSessionOnEndHelper)eventSource;

            helper.Application.ProcessSpecialRequest(
                null,
                _sessionOnEndMethod,
                _sessionOnEndParamCount,
                helper.Source,
                helper.Args,
                helper.Session);
        }
예제 #3
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);
     }
 }
 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);
     }
 }
        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);
            }
        }