TelemetryNotificationService.Subscribe 方法

定义

订阅将在发布与指定筛选器匹配的遥测事件时获得通知。

public int Subscribe (Microsoft.VisualStudio.Telemetry.ITelemetryEventMatch eventMatch, Action<Microsoft.VisualStudio.Telemetry.TelemetryEvent> handler, bool singleNotification = true);
abstract member Subscribe : Microsoft.VisualStudio.Telemetry.ITelemetryEventMatch * Action<Microsoft.VisualStudio.Telemetry.TelemetryEvent> * bool -> int
override this.Subscribe : Microsoft.VisualStudio.Telemetry.ITelemetryEventMatch * Action<Microsoft.VisualStudio.Telemetry.TelemetryEvent> * bool -> int
Public Function Subscribe (eventMatch As ITelemetryEventMatch, handler As Action(Of TelemetryEvent), Optional singleNotification As Boolean = true) As Integer

参数

eventMatch
ITelemetryEventMatch

ITelemetryEventMatch 它表示遥测事件的筛选规则。

handler
Action<TelemetryEvent>

要在发布与指定规则匹配的遥测事件时调用的处理程序。

singleNotification
Boolean

指定是否在引发匹配通知后取消订阅。

返回

Int32

可用于取消订阅通知的订阅 ID。

实现

适用于