EventSource EventSource EventSource EventSource Constructors

Definition

Overloads

EventSource() EventSource() EventSource()

Creates a new instance of the EventSource class.

EventSource(Boolean) EventSource(Boolean) EventSource(Boolean) EventSource(Boolean)

Creates a new instance of the EventSource class and specifies whether to throw an exception when an error occurs in the underlying Windows code.

EventSource(EventSourceSettings) EventSource(EventSourceSettings) EventSource(EventSourceSettings) EventSource(EventSourceSettings)

Creates a new instance of the EventSource class with the specified configuration settings.

EventSource(String) EventSource(String) EventSource(String) EventSource(String)

Creates a new instance of the EventSource class with the specified name.

EventSource(EventSourceSettings, String[]) EventSource(EventSourceSettings, String[]) EventSource(EventSourceSettings, String[]) EventSource(EventSourceSettings, String[])

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

EventSource(String, EventSourceSettings) EventSource(String, EventSourceSettings) EventSource(String, EventSourceSettings) EventSource(String, EventSourceSettings)

Creates a new instance of the EventSource class with the specified name and settings.

EventSource(String, EventSourceSettings, String[]) EventSource(String, EventSourceSettings, String[]) EventSource(String, EventSourceSettings, String[]) EventSource(String, EventSourceSettings, String[])

Creates a new instance of the EventSource class with the specified configuration settings.

EventSource() EventSource() EventSource()

Creates a new instance of the EventSource class.

protected:
 EventSource();
protected EventSource ();
Protected Sub New ()

EventSource(Boolean) EventSource(Boolean) EventSource(Boolean) EventSource(Boolean)

Creates a new instance of the EventSource class and specifies whether to throw an exception when an error occurs in the underlying Windows code.

protected:
 EventSource(bool throwOnEventWriteErrors);
protected EventSource (bool throwOnEventWriteErrors);
new System.Diagnostics.Tracing.EventSource : bool -> System.Diagnostics.Tracing.EventSource
Protected Sub New (throwOnEventWriteErrors As Boolean)

Parameters

throwOnEventWriteErrors
Boolean Boolean Boolean Boolean

true to throw an exception when an error occurs in the underlying Windows code; otherwise, false.

EventSource(EventSourceSettings) EventSource(EventSourceSettings) EventSource(EventSourceSettings) EventSource(EventSourceSettings)

Creates a new instance of the EventSource class with the specified configuration settings.

protected:
 EventSource(System::Diagnostics::Tracing::EventSourceSettings settings);
protected EventSource (System.Diagnostics.Tracing.EventSourceSettings settings);
new System.Diagnostics.Tracing.EventSource : System.Diagnostics.Tracing.EventSourceSettings -> System.Diagnostics.Tracing.EventSource
Protected Sub New (settings As EventSourceSettings)

Parameters

settings
EventSourceSettings EventSourceSettings EventSourceSettings EventSourceSettings

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

Remarks

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.

EventSource(String) EventSource(String) EventSource(String) EventSource(String)

Creates a new instance of the EventSource class with the specified name.

public:
 EventSource(System::String ^ eventSourceName);
public EventSource (string eventSourceName);
new System.Diagnostics.Tracing.EventSource : string -> System.Diagnostics.Tracing.EventSource
Public Sub New (eventSourceName As String)

Parameters

eventSourceName
String String String String

The name to apply to the event source. Must not be null.

Exceptions

EventSource(EventSourceSettings, String[]) EventSource(EventSourceSettings, String[]) EventSource(EventSourceSettings, String[]) EventSource(EventSourceSettings, String[])

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

protected:
 EventSource(System::Diagnostics::Tracing::EventSourceSettings settings, ... cli::array <System::String ^> ^ traits);
protected EventSource (System.Diagnostics.Tracing.EventSourceSettings settings, params string[] traits);
new System.Diagnostics.Tracing.EventSource : System.Diagnostics.Tracing.EventSourceSettings * string[] -> System.Diagnostics.Tracing.EventSource
Protected Sub New (settings As EventSourceSettings, ParamArray traits As String())

Parameters

settings
EventSourceSettings EventSourceSettings EventSourceSettings EventSourceSettings

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

traits
String[]

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

Exceptions

traits is not specified in key-value pairs.

Remarks

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.

See also

EventSource(String, EventSourceSettings) EventSource(String, EventSourceSettings) EventSource(String, EventSourceSettings) EventSource(String, EventSourceSettings)

Creates a new instance of the EventSource class with the specified name and settings.

public:
 EventSource(System::String ^ eventSourceName, System::Diagnostics::Tracing::EventSourceSettings config);
public EventSource (string eventSourceName, System.Diagnostics.Tracing.EventSourceSettings config);
new System.Diagnostics.Tracing.EventSource : string * System.Diagnostics.Tracing.EventSourceSettings -> System.Diagnostics.Tracing.EventSource
Public Sub New (eventSourceName As String, config As EventSourceSettings)

Parameters

eventSourceName
String String String String

The name to apply to the event source. Must not be null.

config
EventSourceSettings EventSourceSettings EventSourceSettings EventSourceSettings

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

Exceptions

Remarks

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.

EventSource(String, EventSourceSettings, String[]) EventSource(String, EventSourceSettings, String[]) EventSource(String, EventSourceSettings, String[]) EventSource(String, EventSourceSettings, String[])

Creates a new instance of the EventSource class with the specified configuration settings.

public:
 EventSource(System::String ^ eventSourceName, System::Diagnostics::Tracing::EventSourceSettings config, ... cli::array <System::String ^> ^ traits);
public EventSource (string eventSourceName, System.Diagnostics.Tracing.EventSourceSettings config, params string[] traits);
new System.Diagnostics.Tracing.EventSource : string * System.Diagnostics.Tracing.EventSourceSettings * string[] -> System.Diagnostics.Tracing.EventSource
Public Sub New (eventSourceName As String, config As EventSourceSettings, ParamArray traits As String())

Parameters

eventSourceName
String String String String

The name to apply to the event source. Must not be null.

config
EventSourceSettings EventSourceSettings EventSourceSettings EventSourceSettings

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

traits
String[]

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

Exceptions

traits is not specified in key-value pairs.

Remarks

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 config 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.

See also

Applies to