private List <HttpApplication.IExecutionStep> GetStepArray(RequestNotification notification, bool isPostEvent)
        {
#if DBG
            Debug.Trace("PipelineRuntime",
                        "GetStepArray for " + DebugModuleName + " for " + notification.ToString() +
                        " and " + isPostEvent + "\r\n");
#endif

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

            if (isPostEvent)
            {
                steps = _modulePostSteps;
            }

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

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

            Debug.Trace("PipelineRuntime",
                        "GetStepArray: " + notification.ToString() + " mapped to index " + index.ToString(CultureInfo.InvariantCulture) + "\r\n");

            List <HttpApplication.IExecutionStep> stepArray = steps[index];
            // we shouldn't be asking for events that aren't mapped to this
            // module at all
            Debug.Assert(null != stepArray, "null != stepArray");

            return(stepArray);
        }
        private List<HttpApplication.IExecutionStep> GetStepArray(RequestNotification notification, bool isPostEvent) {

#if DBG
            Debug.Trace("PipelineRuntime",
                        "GetStepArray for " + DebugModuleName + " for " + notification.ToString() +
                        " and " + isPostEvent + "\r\n");
#endif            

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

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

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

            Debug.Trace("PipelineRuntime",
                        "GetStepArray: " + notification.ToString() + " mapped to index " + index.ToString(CultureInfo.InvariantCulture) + "\r\n");

            List<HttpApplication.IExecutionStep> stepArray = steps[index];
            // we shouldn't be asking for events that aren't mapped to this
            // module at all
            Debug.Assert(null != stepArray, "null != stepArray");            
            
            return stepArray;                
        }
Esempio n. 3
0
        public static PerformanceDataProvider GetStepData(RequestNotification notification)
        {
            if (AspPerformanceData.stepData == null)
            {
                AspPerformanceData.stepData = new Dictionary <RequestNotification, PerformanceDataProvider>(13);
            }
            PerformanceDataProvider performanceDataProvider;

            if (!AspPerformanceData.stepData.TryGetValue(notification, out performanceDataProvider))
            {
                performanceDataProvider = new PerformanceDataProvider(notification.ToString());
                AspPerformanceData.stepData[notification] = performanceDataProvider;
            }
            return(performanceDataProvider);
        }
        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);
        }
        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);
       }
Esempio n. 6
0
 public override string ToString()
 {
     return(string.Format("{0} ({1})", Name, Notification.ToString()));
 }