public void EndContext( HttpContextBase context, string virtualPath, TextWriter writer, int startPosition, int length, bool isLiteral ) { if (IsAvailable) { PageInstrumentationServiceAdapter instrumentationService = GetInstrumentationService(context); if ( instrumentationService != null && instrumentationService.ExecutionListeners.Count > 0 ) { var instrumentationContext = CreateContext( virtualPath, writer, startPosition, length, isLiteral ); foreach ( PageExecutionListenerAdapter listener in instrumentationService.ExecutionListeners ) { listener.EndContext(instrumentationContext); } } } }
private PageInstrumentationServiceAdapter GetInstrumentationService(HttpContextBase context) { // There seems to be the potential for the adapter to be null. if (!_isInstrumentationServiceAdapterInitialized) { _instrumentationServiceAdapter = ExtractInstrumentationService(context); _isInstrumentationServiceAdapterInitialized = true; } return(_instrumentationServiceAdapter); }
private PageInstrumentationServiceAdapter GetInstrumentationService(HttpContextBase context) { // There seems to be the potential for the adapter to be null. if (!_isInstrumentationServiceAdapterInitialized) { _instrumentationServiceAdapter = ExtractInstrumentationService(context); _isInstrumentationServiceAdapterInitialized = true; } return _instrumentationServiceAdapter; }
private void RunOnListeners(HttpContextBase context, Action <PageExecutionListenerAdapter> act) { if (IsAvailable) { PageInstrumentationServiceAdapter instSvc = ExtractInstrumentationService(context); if (instSvc != null) { foreach (PageExecutionListenerAdapter listener in instSvc.ExecutionListeners) { act(listener); } } } }