TelemetryNotificationService.Subscribe 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
订阅将在发布与指定筛选器匹配的遥测事件时获得通知。
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
指定是否在引发匹配通知后取消订阅。
返回
可用于取消订阅通知的订阅 ID。