MetricsBuilderExtensions.AddListener 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddListener(IMetricsBuilder, IMetricsListener) |
註冊新的 IMetricsListener 實例。 |
AddListener<T>(IMetricsBuilder) |
註冊類型的 |
AddListener(IMetricsBuilder, IMetricsListener)
註冊新的 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
參數
- builder
- IMetricsBuilder
- listener
- IMetricsListener
接聽程式的實作類型。
傳回
傳回原始 IMetricsBuilder 的鏈結。
適用於
AddListener<T>(IMetricsBuilder)
註冊類型的T
新 IMetricsListener 。
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
接聽程式的實作類型。
參數
- builder
- IMetricsBuilder
傳回
傳回原始 IMetricsBuilder 的鏈結。