Edit

Share via


RemotePresence.BeginPresenceQuery Method

Definition

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

public:
 IAsyncResult ^ BeginPresenceQuery(System::Collections::Generic::IEnumerable<System::String ^> ^ targets, cli::array <System::String ^> ^ categories, EventHandler<Microsoft::Rtc::Collaboration::Presence::RemotePresenceNotificationEventArgs ^> ^ queryResultHandler, AsyncCallback ^ userCallback, System::Object ^ state);
public IAsyncResult BeginPresenceQuery (System.Collections.Generic.IEnumerable<string> targets, string[] categories, EventHandler<Microsoft.Rtc.Collaboration.Presence.RemotePresenceNotificationEventArgs> queryResultHandler, AsyncCallback userCallback, object state);
member this.BeginPresenceQuery : seq<string> * string[] * EventHandler<Microsoft.Rtc.Collaboration.Presence.RemotePresenceNotificationEventArgs> * AsyncCallback * obj -> IAsyncResult
Public Function BeginPresenceQuery (targets As IEnumerable(Of String), categories As String(), queryResultHandler As EventHandler(Of RemotePresenceNotificationEventArgs), userCallback As AsyncCallback, state As Object) As IAsyncResult

Parameters

targets
IEnumerable<String>

The list of target addresses for the query.

categories
String[]

The list of presence categories for the query. Categories that can be set are "contactCard", "note", "state", "services", and "calendarData".

queryResultHandler
EventHandler<RemotePresenceNotificationEventArgs>

EventHandler to be invoked as results become available. This value can be null.

userCallback
AsyncCallback

The method to be called when the asynchronous operation is completed. This value can be null.

state
Object

A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Returns

An IAsyncResult that references the asynchronous operation.

Exceptions

Thrown when targets is null.

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.

Applies to