DiagnosticSource.IsEnabled DiagnosticSource.IsEnabled DiagnosticSource.IsEnabled DiagnosticSource.IsEnabled Method

Definition

Overloads

IsEnabled(String) IsEnabled(String) IsEnabled(String) IsEnabled(String)

Verifies if the notification event is enabled.

IsEnabled(String, Object, Object) IsEnabled(String, Object, Object) IsEnabled(String, Object, Object)

Verifies it the notification event is enabled.

IsEnabled(String) IsEnabled(String) IsEnabled(String) IsEnabled(String)

Verifies if the notification event is enabled.

public:
 abstract bool IsEnabled(System::String ^ name);
public abstract bool IsEnabled (string name);
abstract member IsEnabled : string -> bool
Public MustOverride Function IsEnabled (name As String) As Boolean

Parameters

name
String String String String

The name of the event being written.

Returns

true if the notification event is enabled, false otherwise.

Remarks

If there is expensive setup for the notification, you can call IsEnabled before performing this setup. Consumers should not assume that they only get notifications for which IsEnabled is true. However, it is optional for producers to call this API. The name should be the same as that passed to .

IsEnabled(String, Object, Object) IsEnabled(String, Object, Object) IsEnabled(String, Object, Object)

Verifies it the notification event is enabled.

public virtual bool IsEnabled (string name, object arg1, object arg2 = null);
abstract member IsEnabled : string * obj * obj -> bool
override this.IsEnabled : string * obj * obj -> bool
Public Overridable Function IsEnabled (name As String, arg1 As Object, Optional arg2 As Object = null) As Boolean

Parameters

name
String String String String

The name of the event being written.

arg1
Object Object Object Object

An object that represents the additional context for IsEnabled. Consumers should expect to receive null which may indicate that producer called pure IsEnabled(string) to check if consumer wants to get notifications for such events at all. Based on that, producer may call IsEnabled(string, object, object) again with non-null context.

arg2
Object Object Object Object

Optional. An object that represents the additional context for IsEnabled. null by default. Consumers should expect to receive null which may indicate that producer called pure IsEnabled(string) or producer passed all necessary context in arg1.

Returns

true if the notification event is enabled, false otherwise.

Remarks

If there is expensive setup for the notification, you can call this method and provide context before performing the setup.

Applies to