Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Web / WebPageTraceListener.cs / 1305376 / WebPageTraceListener.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- using System; using System.Web; using System.Web.UI; using System.Diagnostics; using System.Globalization; using System.Security.Permissions; namespace System.Web { [HostProtection(Synchronization=true)] public class WebPageTraceListener : TraceListener { public WebPageTraceListener() { } // the listener apis public override void Write(string message) { if (Filter != null && !Filter.ShouldTrace(null, String.Empty, TraceEventType.Verbose, 0, message, null, null, null)) return; HttpContext context = HttpContext.Current; if (context != null) context.Trace.WriteInternal(message, false); } public override void Write(string message, string category) { if (Filter != null && !Filter.ShouldTrace(null, String.Empty, TraceEventType.Verbose, 0, message, null, null, null)) return; HttpContext context = HttpContext.Current; if (context != null) context.Trace.WriteInternal(category, message, false); } public override void WriteLine(string message) { if (Filter != null && !Filter.ShouldTrace(null, String.Empty, TraceEventType.Verbose, 0, message, null, null, null)) return; HttpContext context = HttpContext.Current; if (context != null) context.Trace.WriteInternal(message, false); } public override void WriteLine(string message, string category) { if (Filter != null && !Filter.ShouldTrace(null, String.Empty, TraceEventType.Verbose, 0, message, null, null, null)) return; HttpContext context = HttpContext.Current; if (context != null) context.Trace.WriteInternal(category, message, false); } public override void TraceEvent(TraceEventCache eventCache, String source, TraceEventType severity, int id, string message) { if (Filter != null && !Filter.ShouldTrace(eventCache, source, severity, id, message, null, null, null)) return; HttpContext context = HttpContext.Current; if (context == null) return; string messagestring = SR.GetString(SR.WebPageTraceListener_Event) + " " + id + ": " + message; if (severity <= TraceEventType.Warning) context.Trace.WarnInternal(source, messagestring, false); else context.Trace.WriteInternal(source, messagestring, false); } public override void TraceEvent(TraceEventCache eventCache, String source, TraceEventType severity, int id, string format, params object[] args) { TraceEvent(eventCache, source, severity, id, String.Format(CultureInfo.InvariantCulture, format, args)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DBDataPermission.cs
- CurrentChangedEventManager.cs
- ListViewPagedDataSource.cs
- UnsafeNativeMethods.cs
- ExpandedWrapper.cs
- Win32PrintDialog.cs
- LinqDataSourceContextEventArgs.cs
- FlowPosition.cs
- _Rfc2616CacheValidators.cs
- ViewKeyConstraint.cs
- TypeRefElement.cs
- DataGridViewCellFormattingEventArgs.cs
- DeploymentSectionCache.cs
- SoapFault.cs
- AnnotationHelper.cs
- figurelength.cs
- Thumb.cs
- EventMappingSettings.cs
- AsymmetricCryptoHandle.cs
- UserMapPath.cs
- FocusChangedEventArgs.cs
- CompModSwitches.cs
- DataKeyPropertyAttribute.cs
- ObjectSet.cs
- DefinitionUpdate.cs
- ChannelSinkStacks.cs
- MatrixAnimationUsingPath.cs
- RelationshipEndMember.cs
- GridViewSelectEventArgs.cs
- Crc32.cs
- WmlCommandAdapter.cs
- NamespaceExpr.cs
- SEHException.cs
- FixedSchema.cs
- ExitEventArgs.cs
- TypeForwardedToAttribute.cs
- RegionData.cs
- EnumerableCollectionView.cs
- ExecutionContext.cs
- updateconfighost.cs
- PointCollection.cs
- DbConnectionHelper.cs
- TreeNodeBinding.cs
- NeutralResourcesLanguageAttribute.cs
- WebPart.cs
- DataGridViewCellEventArgs.cs
- ExpressionLexer.cs
- BamlLocalizationDictionary.cs
- XmlSchemaValidationException.cs
- SmiEventSink.cs
- MSAAEventDispatcher.cs
- DesignerActionVerbItem.cs
- HtmlLink.cs
- EntityDataSourceViewSchema.cs
- RealizationDrawingContextWalker.cs
- ImageDrawing.cs
- ServiceInfo.cs
- HostProtectionException.cs
- MemoryRecordBuffer.cs
- DesignerTransactionCloseEvent.cs
- InlineCollection.cs
- HttpHostedTransportConfiguration.cs
- SolidColorBrush.cs
- ModifierKeysValueSerializer.cs
- RuntimeIdentifierPropertyAttribute.cs
- GeneratedCodeAttribute.cs
- TextTreeExtractElementUndoUnit.cs
- OdbcTransaction.cs
- DataPagerCommandEventArgs.cs
- ViewCellSlot.cs
- XmlCharCheckingWriter.cs
- SharedDp.cs
- SchemaTableColumn.cs
- SocketPermission.cs
- RoleManagerSection.cs
- ExternalException.cs
- Inflater.cs
- DataGridViewCellPaintingEventArgs.cs
- CollectionViewGroupInternal.cs
- SQLConvert.cs
- SupportsEventValidationAttribute.cs
- ThicknessAnimationBase.cs
- TextStore.cs
- FlowLayoutPanel.cs
- PopupRootAutomationPeer.cs
- EntityProviderFactory.cs
- OrderedEnumerableRowCollection.cs
- AmbientEnvironment.cs
- SystemResources.cs
- EventHandlersStore.cs
- FrugalMap.cs
- InfoCardRSACryptoProvider.cs
- DataBoundControlAdapter.cs
- MasterPage.cs
- MaterializeFromAtom.cs
- GenerateTemporaryTargetAssembly.cs
- ConditionalWeakTable.cs
- BlurBitmapEffect.cs
- RecognizedWordUnit.cs
- StringInfo.cs