语言

EventSource.IsEnabled 方法

定义

确定是否启用当前事件源。

重载

名称 说明
IsEnabled()

确定是否启用当前事件源。

IsEnabled(EventLevel, EventKeywords)

确定是否启用具有指定级别和关键字的当前事件源。

IsEnabled(EventLevel, EventKeywords, EventChannel)

确定是否为具有指定级别、关键字和通道的事件启用当前事件源。

IsEnabled()

Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs

确定是否启用当前事件源。

public:
 bool IsEnabled();
public bool IsEnabled();
member this.IsEnabled : unit -> bool
Public Function IsEnabled () As Boolean

返回

true 如果启用了当前事件源,则为否则,为 false.

适用于

IsEnabled(EventLevel, EventKeywords)

Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs

确定是否启用具有指定级别和关键字的当前事件源。

public:
 bool IsEnabled(System::Diagnostics::Tracing::EventLevel level, System::Diagnostics::Tracing::EventKeywords keywords);
public bool IsEnabled(System.Diagnostics.Tracing.EventLevel level, System.Diagnostics.Tracing.EventKeywords keywords);
member this.IsEnabled : System.Diagnostics.Tracing.EventLevel * System.Diagnostics.Tracing.EventKeywords -> bool
Public Function IsEnabled (level As EventLevel, keywords As EventKeywords) As Boolean

参数

level
EventLevel

事件源的级别。

keywords
EventKeywords

事件源的关键字。

返回

true 如果启用了事件源,则为否则,为 false.

注解

此方法的结果只是特定事件是否处于活动状态的近似值。 使用它可以避免在禁用日志记录时进行日志记录的昂贵计算。 事件源可能具有用于确定其活动的其他筛选。

适用于

IsEnabled(EventLevel, EventKeywords, EventChannel)

Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs
Source:
EventSource.cs

确定是否为具有指定级别、关键字和通道的事件启用当前事件源。

public:
 bool IsEnabled(System::Diagnostics::Tracing::EventLevel level, System::Diagnostics::Tracing::EventKeywords keywords, System::Diagnostics::Tracing::EventChannel channel);
public bool IsEnabled(System.Diagnostics.Tracing.EventLevel level, System.Diagnostics.Tracing.EventKeywords keywords, System.Diagnostics.Tracing.EventChannel channel);
member this.IsEnabled : System.Diagnostics.Tracing.EventLevel * System.Diagnostics.Tracing.EventKeywords * System.Diagnostics.Tracing.EventChannel -> bool
Public Function IsEnabled (level As EventLevel, keywords As EventKeywords, channel As EventChannel) As Boolean

参数

level
EventLevel

要检查的事件级别。 当事件源的级别大于或等于 level时,将被视为启用事件源。

keywords
EventKeywords

要检查的事件关键字。

channel
EventChannel

要检查的事件通道。

返回

true 如果为指定的事件级别、关键字和通道启用了事件源,则为否则,为 false.

此方法的结果只是特定事件是否处于活动状态的近似值。 使用它可以避免在禁用日志记录时进行日志记录的昂贵计算。 事件源可能具有用于确定其活动的其他筛选。

注解

如果

适用于