EventSource.IsEnabled 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
判斷目前事件來源是否已啟用。
多載
| 名稱 | Description |
|---|---|
| IsEnabled() |
判斷目前事件來源是否已啟用。 |
| IsEnabled(EventLevel, EventKeywords) |
判斷目前具有指定等級與關鍵字的事件來源是否被啟用。 |
| IsEnabled(EventLevel, EventKeywords, EventChannel) |
判斷目前事件來源是否啟用,以符合指定等級、關鍵字及通道的事件。 |
IsEnabled()
判斷目前事件來源是否已啟用。
public:
bool IsEnabled();
public bool IsEnabled();
member this.IsEnabled : unit -> bool
Public Function IsEnabled () As Boolean
傳回
true若啟用當前事件來源;否則,。 false
適用於
IsEnabled(EventLevel, EventKeywords)
判斷目前具有指定等級與關鍵字的事件來源是否被啟用。
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)
判斷目前事件來源是否啟用,以符合指定等級、關鍵字及通道的事件。
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
此方法的結果僅是對特定事件是否活躍的近似。 當日誌被關閉時,可以避免昂貴的日誌計算。 事件來源可能有額外的篩選機制來決定其活動。
備註
如果