Begins an asynchronous operation to add a target in the subscription dispatcher and to start the subscription for the given target.

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

Syntax

Visual Basic (Declaration)
Public 
Function 
BeginAddTargets ( _
	
targetsToAdd 
As 
ICollection(
Of 

RemotePresentitySubscriptionTarget), _
	
userCallback 
As 
AsyncCallback, _
	
state 
As 
Object _
) 
As 
IAsyncResult
C#
public 
IAsyncResult 
BeginAddTargets(
	
ICollection<

RemotePresentitySubscriptionTarget> 
targetsToAdd,
	
AsyncCallback 
userCallback,
	
Object 
state
)
Visual C++
public:
IAsyncResult^ 
BeginAddTargets(
	
ICollection<

RemotePresentitySubscriptionTarget^>^ 
targetsToAdd, 
	
AsyncCallback^ 
userCallback, 
	
Object^ 
state
)
JavaScript
function 
beginAddTargets(
targetsToAdd, 
userCallback, 
state);

Parameters

targetsToAdd
Type: ICollection < (Of < ( RemotePresentitySubscriptionTarget > ) > )
The addresses of the targets to add.
userCallback
Type: AsyncCallback
The method to be called when the asynchronous operation is completed.
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

This BeginAddTargets(ICollection < (Of < ( RemotePresentitySubscriptionTarget > ) > ) , AsyncCallback, Object)will return immediately. The application should use the PresenceSubscriptionStateChangedevent handler to track whether the individual targets have been subscribed to.

Exceptions

Exception Condition
ArgumentNullException Thrown when targetsToAddis null.
ArgumentException Thrown when targetsToAddis an empty collection, or when it contains a null member, or when there are no new targets to be added or removed.

See Also