Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / WebPageTraceListener.cs / 1 / 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)] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DependencyPropertyDescriptor.cs
- DataRowComparer.cs
- DLinqDataModelProvider.cs
- DataGridViewComboBoxEditingControl.cs
- altserialization.cs
- EventWaitHandle.cs
- ZipIOExtraFieldZip64Element.cs
- HelpProvider.cs
- StructuralType.cs
- Point4DConverter.cs
- Journaling.cs
- CommunicationObjectAbortedException.cs
- DefaultTraceListener.cs
- CharUnicodeInfo.cs
- ProfileEventArgs.cs
- DataGridViewRow.cs
- PositiveTimeSpanValidator.cs
- IProvider.cs
- EncoderParameters.cs
- DesignerSerializerAttribute.cs
- SqlAggregateChecker.cs
- SignedPkcs7.cs
- MDIControlStrip.cs
- MatrixKeyFrameCollection.cs
- OutputCacheSettingsSection.cs
- ThreadPool.cs
- CssStyleCollection.cs
- Converter.cs
- TemplateControlCodeDomTreeGenerator.cs
- Odbc32.cs
- DataPagerCommandEventArgs.cs
- SerializationInfoEnumerator.cs
- Scene3D.cs
- IncrementalReadDecoders.cs
- SqlCachedBuffer.cs
- MyContact.cs
- MemberRelationshipService.cs
- CursorConverter.cs
- InputBuffer.cs
- IntSecurity.cs
- TextServicesHost.cs
- ManagedFilter.cs
- ChangePassword.cs
- Oci.cs
- LoadWorkflowCommand.cs
- ProviderBase.cs
- ResourceIDHelper.cs
- ThemeInfoAttribute.cs
- IgnoreSection.cs
- Control.cs
- CornerRadiusConverter.cs
- FileCodeGroup.cs
- SiteMap.cs
- HtmlEncodedRawTextWriter.cs
- SamlAuthorizationDecisionClaimResource.cs
- SingleConverter.cs
- DbConnectionClosed.cs
- SerializationObjectManager.cs
- ObjectHandle.cs
- KeyTime.cs
- Roles.cs
- MessageDirection.cs
- PropertyPathConverter.cs
- AdornerDecorator.cs
- ValidationPropertyAttribute.cs
- EventWaitHandleSecurity.cs
- Renderer.cs
- OpenTypeCommon.cs
- ObjectStateEntryDbDataRecord.cs
- PropertyEmitter.cs
- PartialList.cs
- DesignerActionPanel.cs
- ToolBarTray.cs
- ISAPIRuntime.cs
- PropertyDescriptorGridEntry.cs
- MdiWindowListItemConverter.cs
- ReflectPropertyDescriptor.cs
- XamlBuildProvider.cs
- SQLInt16Storage.cs
- WebPartTransformer.cs
- SimpleRecyclingCache.cs
- InternalCache.cs
- Double.cs
- PropertyContainer.cs
- DesignerCommandSet.cs
- _NetworkingPerfCounters.cs
- XamlPoint3DCollectionSerializer.cs
- EntitySqlQueryCacheKey.cs
- EncoderBestFitFallback.cs
- ItemMap.cs
- XmlCDATASection.cs
- FixedSOMGroup.cs
- XmlLoader.cs
- FigureParagraph.cs
- PhysicalAddress.cs
- ClockController.cs
- CompositionTarget.cs
- HttpModulesSection.cs
- SimpleBitVector32.cs
- NameNode.cs