EventSource Constructor (EventSourceSettings, array<String^>^)

.NET Framework (current version)
 

Initializes a new instance of the EventSource to be used with non-contract events that contains the specified settings and traits.

Namespace:   System.Diagnostics.Tracing
Assembly:  mscorlib (in mscorlib.dll)

protected:
EventSource(
	EventSourceSettings settings,
	... array<String^>^ traits
)

Parameters

settings
Type: System.Diagnostics.Tracing::EventSourceSettings

A bitwise combination of the enumeration values that specify the configuration settings to apply to the event source.

traits
Type: array<System::String^>^

The key-value pairs that specify traits for the event source.

Exception Condition
ArgumentException

traits is not specified in key-value pairs.

Traits provide additional information for an event and are interpreted by an event listener. Traits are specified as key-value pairs and if not specified in pairs, an exception will occur. You can retrieve a trait by passing the key to the GetTrait, method.

Specifying settings when the EventSource is constructed enables you to specify whether the event is written in a manifest-based or a self-describing format. In addition, you can specify that an exception should be raised when an error occurs during the event-writing process.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.6
Return to top
Show: