示例#1
0
            internal void AddHandler(object eventId, BeginEventHandler beginHandler, EndEventHandler endHandler, object state, RequestNotification requestNotification, bool isPost, NetHttpApplication app)
            {
                if (_table == null)
                {
                    _table = new Hashtable();
                }
                var handler = (AsyncAppEventHandler)_table[eventId];

                if (handler == null)
                {
                    handler         = new AsyncAppEventHandler();
                    _table[eventId] = handler;
                }
                handler.Add(beginHandler, endHandler, state);
                //if (HttpRuntime.UseIntegratedPipeline)
                //{
                //    var step = new AsyncEventExecutionStep(app, beginHandler, endHandler, state);
                //    app.AddEventMapping(app.CurrentModuleCollectionKey, requestNotification, isPost, step);
                //}
            }
            internal void AddHandler(Object eventId, BeginEventHandler beginHandler,
                                     EndEventHandler endHandler, Object state,
                                     RequestNotification requestNotification,
                                     bool isPost, HttpApplication app) {
                if (_table == null)
                    _table = new Hashtable();

                AsyncAppEventHandler asyncHandler = (AsyncAppEventHandler)_table[eventId];

                if (asyncHandler == null) {
                    asyncHandler = new AsyncAppEventHandler();
                    _table[eventId] = asyncHandler;
                }

                asyncHandler.Add(beginHandler, endHandler, state);

                if (HttpRuntime.UseIntegratedPipeline) {
                    AsyncEventExecutionStep step =
                        new AsyncEventExecutionStep(app,
                                                    beginHandler,
                                                    endHandler,
                                                    state);

                    app.AddEventMapping(app.CurrentModuleCollectionKey, requestNotification, isPost, step);
                }
            }