共用方式為


MetricsBuilderExtensions.AddListener 方法

定義

多載

AddListener(IMetricsBuilder, IMetricsListener)

註冊新的 IMetricsListener 實例。

AddListener<T>(IMetricsBuilder)

註冊類型的TIMetricsListener

AddListener(IMetricsBuilder, IMetricsListener)

來源:
MetricsBuilderExtensions.Listeners.cs
來源:
MetricsBuilderExtensions.Listeners.cs
來源:
MetricsBuilderExtensions.Listeners.cs
來源:
MetricsBuilderExtensions.Listeners.cs

註冊新的 IMetricsListener 實例。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ AddListener(Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ builder, Microsoft::Extensions::Diagnostics::Metrics::IMetricsListener ^ listener);
public static Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder AddListener (this Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder builder, Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener listener);
static member AddListener : Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder * Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener -> Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder
<Extension()>
Public Function AddListener (builder As IMetricsBuilder, listener As IMetricsListener) As IMetricsBuilder

參數

listener
IMetricsListener

接聽程式的實作類型。

傳回

傳回原始 IMetricsBuilder 的鏈結。

適用於

AddListener<T>(IMetricsBuilder)

來源:
MetricsBuilderExtensions.Listeners.cs
來源:
MetricsBuilderExtensions.Listeners.cs
來源:
MetricsBuilderExtensions.Listeners.cs
來源:
MetricsBuilderExtensions.Listeners.cs

註冊類型的TIMetricsListener

public:
generic <typename T>
 where T : class, Microsoft::Extensions::Diagnostics::Metrics::IMetricsListener[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ AddListener(Microsoft::Extensions::Diagnostics::Metrics::IMetricsBuilder ^ builder);
public static Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder AddListener<T> (this Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder builder) where T : class, Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener;
static member AddListener : Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder -> Microsoft.Extensions.Diagnostics.Metrics.IMetricsBuilder (requires 'T : null and 'T :> Microsoft.Extensions.Diagnostics.Metrics.IMetricsListener)
<Extension()>
Public Function AddListener(Of T As {Class, IMetricsListener}) (builder As IMetricsBuilder) As IMetricsBuilder

類型參數

T

接聽程式的實作類型。

參數

傳回

傳回原始 IMetricsBuilder 的鏈結。

適用於