Share via


RemotePresence.BeginAddTargets Method

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

'Declaration
Public Function BeginAddTargets ( _
    targetsToAdd As ICollection(Of RemotePresentitySubscriptionTarget), _
    userCallback As AsyncCallback, _
    state As Object _
) As IAsyncResult
'Usage
Dim instance As RemotePresence
Dim targetsToAdd As ICollection(Of RemotePresentitySubscriptionTarget)
Dim userCallback As AsyncCallback
Dim state As Object
Dim returnValue As IAsyncResult

returnValue = instance.BeginAddTargets(targetsToAdd, _
    userCallback, state)
public IAsyncResult BeginAddTargets(
    ICollection<RemotePresentitySubscriptionTarget> targetsToAdd,
    AsyncCallback userCallback,
    Object state
)

Parameters

  • userCallback
    Type: System.AsyncCallback
    The method to be called when the asynchronous operation is completed.
  • 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 targetsToAdd is null.

ArgumentException

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

Remarks

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

See Also

Reference

RemotePresence Class

RemotePresence Members

Microsoft.Rtc.Collaboration.Presence Namespace