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 。