DiagnosticListener DiagnosticListener DiagnosticListener DiagnosticListener Class

定義

提供抽象的 DiagnosticSource 類別實作,表示來源傳送其資訊 (事件) 的具名位置。Provides an implementation of the abstract DiagnosticSource class that represents a named place to which a source sends its information (events).

public ref class DiagnosticListener : System::Diagnostics::DiagnosticSource, IDisposable, IObservable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>
public class DiagnosticListener : System.Diagnostics.DiagnosticSource, IDisposable, IObservable<System.Collections.Generic.KeyValuePair<string,object>>
type DiagnosticListener = class
    inherit DiagnosticSource
    interface IDisposable
    interface IObservable<KeyValuePair<string, obj>>
Public Class DiagnosticListener
Inherits DiagnosticSource
Implements IDisposable, IObservable(Of KeyValuePair(Of String, Object))
繼承
DiagnosticListenerDiagnosticListenerDiagnosticListenerDiagnosticListener
實作

備註

如需詳細資訊DiagnosticSourceDiagnosticListener類別,請參閱DiagnosticSource 使用者指南For more information on the DiagnosticSource and DiagnosticListener classes, see DiagnosticSource User's Guide.

建構函式

DiagnosticListener(String) DiagnosticListener(String) DiagnosticListener(String) DiagnosticListener(String)

建立新的 DiagnosticListenerCreates a new DiagnosticListener.

屬性

AllListeners AllListeners AllListeners AllListeners

取得此 DiagnosticListener 的接聽程式集合。Gets the collection of listeners for this DiagnosticListener.

Name Name Name Name

取得這個 DiagnosticListener 的名稱。Gets the name of this DiagnosticListener.

方法

Dispose() Dispose() Dispose() Dispose()

處置 NotificationListeners。Disposes the NotificationListeners.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IsEnabled() IsEnabled() IsEnabled() IsEnabled()

判斷是否有任何已註冊的訂閱者。Determines whether there are any registered subscribers.

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

檢查是否啟用 DiagnosticListenerChecks whether the DiagnosticListener is enabled.

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

檢查是否啟用 DiagnosticListener。Checks if the DiagnosticListener is enabled.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnActivityExport(Activity, Object) OnActivityExport(Activity, Object) OnActivityExport(Activity, Object) OnActivityExport(Activity, Object)
OnActivityImport(Activity, Object) OnActivityImport(Activity, Object) OnActivityImport(Activity, Object) OnActivityImport(Activity, Object)
StartActivity(Activity, Object) StartActivity(Activity, Object) StartActivity(Activity, Object) StartActivity(Activity, Object)

啟動 Activity 並寫入啟動事件。Starts an Activity and writes a start event.

(Inherited from DiagnosticSource)
StopActivity(Activity, Object) StopActivity(Activity, Object) StopActivity(Activity, Object) StopActivity(Activity, Object)

停止指定的 Activity,維護全域 Current 活動,然後通知取用者已停止 ActivityStops the given Activity, maintains the global Current activity, and notifies consumers that the Activity was stopped.

(Inherited from DiagnosticSource)
Subscribe(IObserver<KeyValuePair<String,Object>>) Subscribe(IObserver<KeyValuePair<String,Object>>) Subscribe(IObserver<KeyValuePair<String,Object>>) Subscribe(IObserver<KeyValuePair<String,Object>>)
Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>) Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>) Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>) Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>)

新增訂閱者。Adds a subscriber. 如果 isEnabled 參數不是 null,則其會指出某些事件不重要,可以略過以提升效率。If the isEnabled parameter is not null, it indicates that some events are uninteresting can be skipped for efficiency.

Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>, Action<Activity,Object>, Action<Activity,Object>) Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>, Action<Activity,Object>, Action<Activity,Object>) Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>, Action<Activity,Object>, Action<Activity,Object>) Subscribe(IObserver<KeyValuePair<String,Object>>, Func<String,Object,Object,Boolean>, Action<Activity,Object>, Action<Activity,Object>)
Subscribe(IObserver<KeyValuePair<String,Object>>, Predicate<String>) Subscribe(IObserver<KeyValuePair<String,Object>>, Predicate<String>) Subscribe(IObserver<KeyValuePair<String,Object>>, Predicate<String>) Subscribe(IObserver<KeyValuePair<String,Object>>, Predicate<String>)

新增訂閱者 (Observer)。Add a subscriber (Observer). 如果 isEnabled 參數不是 null,它會指出某些事件不重要,可以略過以提升效率。If the isEnabled parameter is not null, it indicates that some events are uninteresting and can be skipped for efficiency.

ToString() ToString() ToString() ToString()

傳回名稱為此 DiagnosticListener 的字串。Returns a string with the name of this DiagnosticListener.

Write(String, Object) Write(String, Object) Write(String, Object) Write(String, Object)

適用於