コード例 #1
0
        internal void AddEvent(RequestNotification notification, bool isPostEvent, HttpApplication.IExecutionStep step)
        {
            int index = EventToIndex(notification);

            List <HttpApplication.IExecutionStep>[] listArray = null;
            if (isPostEvent)
            {
                if (this._modulePostSteps == null)
                {
                    this._modulePostSteps = new List <HttpApplication.IExecutionStep> [0x20];
                }
                listArray = this._modulePostSteps;
            }
            else
            {
                if (this._moduleSteps == null)
                {
                    this._moduleSteps = new List <HttpApplication.IExecutionStep> [0x20];
                }
                listArray = this._moduleSteps;
            }
            List <HttpApplication.IExecutionStep> list = listArray[index];

            if (list == null)
            {
                list             = new List <HttpApplication.IExecutionStep>();
                listArray[index] = list;
            }
            list.Add(step);
        }
コード例 #2
0
        internal void AddEvent(RequestNotification notification, bool isPostEvent, HttpApplication.IExecutionStep step)
        {
            int index = EventToIndex(notification);

#if DBG
            Debug.Trace("PipelineRuntime", "Adding event: " + DebugModuleName + " " + notification.ToString() + " " +
                        isPostEvent.ToString() + "@ index " + index.ToString(CultureInfo.InvariantCulture) + "\r\n");
#endif

            Debug.Assert(index != -1, "index != -1");

            List <HttpApplication.IExecutionStep>[] steps = null;

            if (isPostEvent)
            {
                if (null == _modulePostSteps)
                {
                    _modulePostSteps = new List <HttpApplication.IExecutionStep> [32];
                }
                steps = _modulePostSteps;
            }
            else
            {
                if (null == _moduleSteps)
                {
                    _moduleSteps = new List <HttpApplication.IExecutionStep> [32];
                }

                steps = _moduleSteps;
            }

            Debug.Assert(steps != null, "steps != null");

            // retrieve the steps for this event (typically none at this point)
            // allocate a new container as necessary and add this step
            // in the event that a single module has registered more than once
            // for a given event, we'll have multiple steps here
            List <HttpApplication.IExecutionStep> stepArray = steps[index];
            if (null == stepArray)
            {
                // first touch, instantiate and save it
                stepArray    = new List <HttpApplication.IExecutionStep>();
                steps[index] = stepArray;
            }

            stepArray.Add(step);
        }