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

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

Syntax

Visual Basic (Declaration)
Public 
Function 
BeginPresenceQuery ( _
	
targets 
As 
IEnumerable(
Of 
String), _
	
categories 
As 
String(), _
	
queryResultHandler 
As 
EventHandler(
Of 

RemotePresenceNotificationEventArgs), _
	
userCallback 
As 
AsyncCallback, _
	
state 
As 
Object _
) 
As 
IAsyncResult
C#
public 
IAsyncResult 
BeginPresenceQuery(
	
IEnumerable<
string> 
targets,
	
string[] 
categories,
	
EventHandler<

RemotePresenceNotificationEventArgs> 
queryResultHandler,
	
AsyncCallback 
userCallback,
	
Object 
state
)
Visual C++
public:
IAsyncResult^ 
BeginPresenceQuery(
	
IEnumerable<
String^>^ 
targets, 
	
array<
String^>^ 
categories, 
	
EventHandler<

RemotePresenceNotificationEventArgs^>^ 
queryResultHandler, 
	
AsyncCallback^ 
userCallback, 
	
Object^ 
state
)
JavaScript
function 
beginPresenceQuery(
targets, 
categories, 
queryResultHandler, 
userCallback, 
state);

Parameters

targets
Type: IEnumerable < (Of < ( String > ) > )
The list of target addresses for the query.
categories
Type: array< String > [] () []
The list of presence categories for the query. Categories that can be set are "contactCard", "note", "state", "services", and "calendarData".
queryResultHandler
Type: EventHandler < (Of < ( RemotePresenceNotificationEventArgs > ) > )
EventHandler to be invoked as results become available. This value can be null.
userCallback
Type: AsyncCallback
The method to be called when the asynchronous operation is completed. This value can be null.
state
Type: Object
A user-provided object that distinguishes this particular asynchronous operation from other asynchronous operations.

Return Value

An IAsyncResult that references the asynchronous operation.

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