Partilhar via


LocalEndpointPresenceServices.BeginPresenceQuery Method

Begins a presence query request for a given list of targets for the given set of presence categories.

Namespace:  Microsoft.Rtc.Collaboration
Assembly:  Microsoft.Rtc.Collaboration (in Microsoft.Rtc.Collaboration.dll)

Syntax

'Declaration
Public Function BeginPresenceQuery ( _
    targets As IEnumerable(Of String), _
    categories As String(), _
    queryResultHandler As EventHandler(Of RemotePresentitiesNotificationEventArgs), _
    userCallback As AsyncCallback, _
    state As Object _
) As IAsyncResult
'Usage
Dim instance As LocalEndpointPresenceServices
Dim targets As IEnumerable(Of String)
Dim categories As String()
Dim queryResultHandler As EventHandler(Of RemotePresentitiesNotificationEventArgs)
Dim userCallback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginPresenceQuery(targets, _
    categories, queryResultHandler, _
    userCallback, state)
public IAsyncResult BeginPresenceQuery(
    IEnumerable<string> targets,
    string[] categories,
    EventHandler<RemotePresentitiesNotificationEventArgs> queryResultHandler,
    AsyncCallback userCallback,
    Object state
)

Parameters

  • categories
    Type: []
    The list of presence categories for the query. Categories that can be set are "contactCard", "note", "state", "services", and "calendarData".
  • userCallback
    Type: System.AsyncCallback
    The method to be called when the asynchronous operation is completed. This value can be null.
  • state
    Type: System.Object
    A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Return Value

Type: System.IAsyncResult
An IAsyncResult that references the asynchronous operation.

Exceptions

Exception Condition
ArgumentNullException

Thrown when targets is null.

ArgumentException

Thrown when targets is an empty collection, or when it contains a null member, or when there are no new targets to be added or removed.

Remarks

A presence query internally can involve multiple query requests to different single and pool targets. If the user specified a query result handler, then results will be notified on the given event handler as soon as they are available. Calling EndPresenceQuery will return all results for the query.

See Also

Reference

LocalEndpointPresenceServices Class

LocalEndpointPresenceServices Members

Microsoft.Rtc.Collaboration Namespace