EventTypeFilter.ShouldTrace Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether the trace listener should trace the event.
public:
override bool ShouldTrace(System::Diagnostics::TraceEventCache ^ cache, System::String ^ source, System::Diagnostics::TraceEventType eventType, int id, System::String ^ formatOrMessage, cli::array <System::Object ^> ^ args, System::Object ^ data1, cli::array <System::Object ^> ^ data);
public override bool ShouldTrace (System.Diagnostics.TraceEventCache? cache, string source, System.Diagnostics.TraceEventType eventType, int id, string? formatOrMessage, object?[]? args, object? data1, object?[]? data);
public override bool ShouldTrace (System.Diagnostics.TraceEventCache cache, string source, System.Diagnostics.TraceEventType eventType, int id, string formatOrMessage, object[] args, object data1, object[] data);
override this.ShouldTrace : System.Diagnostics.TraceEventCache * string * System.Diagnostics.TraceEventType * int * string * obj[] * obj * obj[] -> bool
Public Overrides Function ShouldTrace (cache As TraceEventCache, source As String, eventType As TraceEventType, id As Integer, formatOrMessage As String, args As Object(), data1 As Object, data As Object()) As Boolean
Parameters
- cache
- TraceEventCache
A TraceEventCache that represents the information cache for the trace event.
- source
- String
The name of the source.
- eventType
- TraceEventType
One of the TraceEventType values.
- id
- Int32
A trace identifier number.
- formatOrMessage
- String
The format to use for writing an array of arguments, or a message to write.
- args
- Object[]
An array of argument objects.
- data1
- Object
A trace data object.
- data
- Object[]
An array of trace data objects.
Returns
true
if the trace should be produced; otherwise, false
.
Remarks
If the value of the eventType
parameter is greater than or equal to the value of the EventType property, the method returns true
.