ITelemetryNotificationService.Subscribe Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Subscribes to be notified when a telemetry event matching the specified filter is posted.
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
Public Function Subscribe (eventMatch As ITelemetryEventMatch, handler As Action(Of TelemetryEvent), Optional singleNotification As Boolean = true) As Integer
Parameters
- eventMatch
- ITelemetryEventMatch
The ITelemetryEventMatch representing the filter rule for telemetry events.
- handler
- Action<TelemetryEvent>
The handler to be invoked when a telemetry event matching the specified rule is posted.
- singleNotification
- Boolean
Specifies whether to unsubscribe once a matching notification is raised.
Returns
A subscription ID that can be used to unsubscribe from notifications.
Exceptions
If handler
is null.