TraceListener::Filter Property
Gets and sets the trace filter for the trace listener.
Assembly: System (in System.dll)
[ComVisibleAttribute(false)] public: property TraceFilter^ Filter { TraceFilter^ get (); void set (TraceFilter^ value); }
Property Value
Type: System.Diagnostics::TraceFilterAn object derived from the TraceFilter base class.
A trace filter can be added to a trace listener to provide a layer of screening beyond that provided to the trace source by switches. For example, the EventTypeFilter can be added to a trace listener to control the event types that are output by the listener. Listeners that are called because the switch criteria are met can query their filter, if present, to determine if a trace is to be sent to output.
The following code example shows how to use the Filter property to add a source filter to a console trace listener. This code example is part of a larger example provided for the TraceSource class.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.