Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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)); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Mapping.cs
- WizardForm.cs
- RightsManagementProvider.cs
- WorkflowInstanceTerminatedRecord.cs
- WebHttpSecurityModeHelper.cs
- infer.cs
- EncodingNLS.cs
- DebugController.cs
- X509Extension.cs
- BitmapPalette.cs
- HtmlInputHidden.cs
- ToolTipAutomationPeer.cs
- SettingsPropertyNotFoundException.cs
- SafeNativeMethodsMilCoreApi.cs
- HebrewCalendar.cs
- ClientTarget.cs
- MessageQueueAccessControlEntry.cs
- CapabilitiesAssignment.cs
- Camera.cs
- RadioButtonAutomationPeer.cs
- URL.cs
- TransferRequestHandler.cs
- PerfProviderCollection.cs
- ConfigurationValues.cs
- MenuAdapter.cs
- Int32.cs
- Authorization.cs
- WebPartDisplayModeEventArgs.cs
- securitycriticaldataformultiplegetandset.cs
- XPathSelectionIterator.cs
- TrackingProfileSerializer.cs
- ToolStripContentPanel.cs
- DbDataSourceEnumerator.cs
- _ProxyRegBlob.cs
- RectangleConverter.cs
- DataMemberFieldConverter.cs
- DataKeyArray.cs
- ExceptionHandler.cs
- EntityStoreSchemaGenerator.cs
- HandleRef.cs
- UInt16.cs
- CodeTypeMemberCollection.cs
- WebEventCodes.cs
- AesManaged.cs
- CallContext.cs
- EllipseGeometry.cs
- LeaseManager.cs
- SoapAttributeOverrides.cs
- RunInstallerAttribute.cs
- XmlQueryContext.cs
- NameValueFileSectionHandler.cs
- Function.cs
- ToolStripGrip.cs
- PropertyManager.cs
- FileUtil.cs
- SchemaRegistration.cs
- Content.cs
- TextContainerChangeEventArgs.cs
- _AcceptOverlappedAsyncResult.cs
- WizardStepBase.cs
- ExpressionConverter.cs
- TemplatePropertyEntry.cs
- LogEntry.cs
- DateTimeValueSerializerContext.cs
- XmlSchemaCompilationSettings.cs
- QueryAccessibilityHelpEvent.cs
- ConstraintCollection.cs
- LambdaCompiler.Statements.cs
- ListChunk.cs
- RoleManagerSection.cs
- SoapCommonClasses.cs
- Reference.cs
- ClassHandlersStore.cs
- Zone.cs
- PieceNameHelper.cs
- FormViewPagerRow.cs
- Nodes.cs
- LayoutEditorPart.cs
- LinqDataSourceValidationException.cs
- OracleCommand.cs
- StringPropertyBuilder.cs
- PolyQuadraticBezierSegment.cs
- Style.cs
- DialogWindow.cs
- ZipIOCentralDirectoryBlock.cs
- FrameworkContentElementAutomationPeer.cs
- UIPropertyMetadata.cs
- RoutedEvent.cs
- PagePropertiesChangingEventArgs.cs
- SQLMoney.cs
- EntitySetBase.cs
- TableStyle.cs
- ClientEventManager.cs
- Scene3D.cs
- securitycriticaldataformultiplegetandset.cs
- ConfigurationElementCollection.cs
- StoreContentChangedEventArgs.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- OleDbDataReader.cs
- SecUtil.cs