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
- DocumentsTrace.cs
- KeyConstraint.cs
- DataServices.cs
- MethodBuilder.cs
- documentsequencetextcontainer.cs
- AnchoredBlock.cs
- LessThanOrEqual.cs
- MutexSecurity.cs
- IdentityNotMappedException.cs
- XPathNodeHelper.cs
- AuthenticationSection.cs
- TextServicesManager.cs
- COM2ExtendedTypeConverter.cs
- Point3DConverter.cs
- Stylus.cs
- OleCmdHelper.cs
- NameTable.cs
- MetaTable.cs
- UIPermission.cs
- AccessibleObject.cs
- PathFigureCollection.cs
- HttpResponseWrapper.cs
- TextRangeEditTables.cs
- BaseTemplateBuildProvider.cs
- SystemKeyConverter.cs
- ActivityBuilderHelper.cs
- TripleDESCryptoServiceProvider.cs
- HttpListenerContext.cs
- ConfigXmlText.cs
- ScriptManagerProxy.cs
- SelectionProviderWrapper.cs
- JsonReader.cs
- URLIdentityPermission.cs
- ResourceFallbackManager.cs
- PartialTrustVisibleAssemblyCollection.cs
- NumberSubstitution.cs
- SqlProcedureAttribute.cs
- XhtmlBasicLinkAdapter.cs
- EntityDataSourceChangingEventArgs.cs
- ConnectionStringEditor.cs
- Attribute.cs
- Filter.cs
- WeakEventManager.cs
- AxParameterData.cs
- EncoderParameter.cs
- XmlExtensionFunction.cs
- RestClientProxyHandler.cs
- CodeMethodMap.cs
- InvokeProviderWrapper.cs
- Soap.cs
- XmlReflectionMember.cs
- XsdBuildProvider.cs
- Helpers.cs
- RawKeyboardInputReport.cs
- ObjectItemCollection.cs
- smtppermission.cs
- Int64Storage.cs
- TrackingStringDictionary.cs
- EnumDataContract.cs
- DetailsViewRow.cs
- Block.cs
- IRCollection.cs
- XhtmlConformanceSection.cs
- Slider.cs
- Exception.cs
- ClassDataContract.cs
- SmtpSection.cs
- ProcessHostServerConfig.cs
- LockRecoveryTask.cs
- FunctionDefinition.cs
- ProfilePropertyMetadata.cs
- IssuanceTokenProviderState.cs
- SafeSystemMetrics.cs
- XmlIlTypeHelper.cs
- TypeInfo.cs
- AutomationFocusChangedEventArgs.cs
- LayoutEvent.cs
- Stylesheet.cs
- TraceXPathNavigator.cs
- AvtEvent.cs
- MutexSecurity.cs
- RawStylusInputReport.cs
- GenericAuthenticationEventArgs.cs
- TemplatePagerField.cs
- _ListenerAsyncResult.cs
- XmlChoiceIdentifierAttribute.cs
- CompositeDuplexBindingElement.cs
- WindowsClaimSet.cs
- TableAdapterManagerHelper.cs
- COSERVERINFO.cs
- EncryptedData.cs
- FigureHelper.cs
- ScalarOps.cs
- DataGridCell.cs
- BreakSafeBase.cs
- XmlMapping.cs
- HtmlLink.cs
- LOSFormatter.cs
- GPRECT.cs
- LassoHelper.cs