แก้ไข

แชร์ผ่าน


PeerContact.InviteAsync Method

Definition

Begins an asynchronous invitation operation for an endpoint to join a PeerCollaboration application sponsored by the sender of the invitation.

Overloads

InviteAsync(Object)

Begins an asynchronous invitation operation for an endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. The invitation is identified using the specified Object.

InviteAsync(PeerEndPoint, Object)

Begins an asynchronous invitation operation for the specified peer endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. The invitation is identified using the specified Object.

InviteAsync(PeerApplication, String, Byte[], Object)

Begins an asynchronous invitation operation for the specified peer endpoints to join the specified collaboration PeerApplication sponsored by the sender of the invitation.

InviteAsync(PeerEndPoint, String, Byte[], PeerApplication, Object)

Begins an asynchronous invitation operation for the specified peerEndPoint to join the specified collaboration PeerApplication sponsored by the sender of the invitation.

Remarks

The caller is not required to sign-in to the System.Net.PeerToPeer.Collaboration infrastructure for this method to complete successfully. A PeerInvitationResponse from the invitee is not the same as the invitee accepting the invitation to collaborate. If an invitation is sent to a remote peer that has not installed the application, the invitation is automatically declined.

InviteAsync(Object)

Begins an asynchronous invitation operation for an endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. The invitation is identified using the specified Object.

public:
 override void InviteAsync(System::Object ^ userToken);
[System.Security.SecurityCritical]
public override void InviteAsync (object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : obj -> unit
Public Overrides Sub InviteAsync (userToken As Object)

Parameters

userToken
Object

User-defined object to pass to the callback of the asynchronous operation. Also used to identify the asynchronous operation for cancellation. This parameter must be specified and is unique across all asynchronous invitation operations in progress.

Attributes

Exceptions

UserToken cannot be null.

The PeerEndPoint object has been disposed.

Remarks

The caller is not required to sign-in to the System.Net.PeerToPeer.Collaboration infrastructure for this method to complete successfully. A PeerInvitationResponse from the invitee is not the same as the invitee accepting the invitation to collaborate. If an invitation is sent to a remote peer that has not installed the application, the invitation is automatically declined.

Notes to Callers

Additional overloads are defined on the Peer class instead of the subclasses PeerContact and PeerNearMe.

Calling this method requires a PermissionState of Unrestricted. This state is created when the peer collaboration session begins.

See also

Applies to

InviteAsync(PeerEndPoint, Object)

Begins an asynchronous invitation operation for the specified peer endpoint to join a PeerCollaboration application sponsored by the sender of the invitation. The invitation is identified using the specified Object.

public:
 void InviteAsync(System::Net::PeerToPeer::Collaboration::PeerEndPoint ^ peerEndPoint, System::Object ^ userToken);
[System.Security.SecurityCritical]
public void InviteAsync (System.Net.PeerToPeer.Collaboration.PeerEndPoint peerEndPoint, object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : System.Net.PeerToPeer.Collaboration.PeerEndPoint * obj -> unit
Public Sub InviteAsync (peerEndPoint As PeerEndPoint, userToken As Object)

Parameters

peerEndPoint
PeerEndPoint

The endpoint or remote peer to which to send the invitation.

userToken
Object

User-defined object to pass to the callback of the asynchronous operation. Also used to identify the asynchronous operation for cancellation. This parameter must be specified and is unique across all asynchronous invitation operations in progress.

Attributes

Exceptions

  • UserToken cannot be null.

  • Endpoint in peerEndPoint cannot be null.

peerEndPoint object cannot be null.

The PeerEndPoint object has been disposed.

The Guid for the current application does not exist or is empty.

Remarks

The caller is not required to sign-in to the System.Net.PeerToPeer.Collaboration infrastructure for this method to complete successfully. A PeerInvitationResponse from the invitee is not the same as the invitee accepting the invitation to collaborate. If an invitation is sent to a remote peer that has not installed the application, the invitation is automatically declined.

Notes to Callers

Additional overloads are defined on the Peer class instead of the subclasses PeerContact and PeerNearMe.

Calling this method requires a PermissionState of Unrestricted. This state is created when the peer collaboration session begins.

See also

Applies to

InviteAsync(PeerApplication, String, Byte[], Object)

Begins an asynchronous invitation operation for the specified peer endpoints to join the specified collaboration PeerApplication sponsored by the sender of the invitation.

public:
 override void InviteAsync(System::Net::PeerToPeer::Collaboration::PeerApplication ^ applicationToInvite, System::String ^ message, cli::array <System::Byte> ^ invitationData, System::Object ^ userToken);
[System.Security.SecurityCritical]
public override void InviteAsync (System.Net.PeerToPeer.Collaboration.PeerApplication applicationToInvite, string message, byte[] invitationData, object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : System.Net.PeerToPeer.Collaboration.PeerApplication * string * byte[] * obj -> unit
Public Overrides Sub InviteAsync (applicationToInvite As PeerApplication, message As String, invitationData As Byte(), userToken As Object)

Parameters

applicationToInvite
PeerApplication

The application for which the invitation is sent.

message
String

A message to send to the remote peer along with the application invitation. The message can be no more than 255 Unicode characters.

invitationData
Byte[]

A user-defined data blob to associate with the invitation. Its size can be no more than 16,384 bytes.

userToken
Object

User-defined object to pass to the callback of the asynchronous operation. Also used to identify the asynchronous operation for cancellation. This parameter must be specified and is unique across all asynchronous invitation operations in progress.

Attributes

Exceptions

UserToken cannot be null.

PeerApplication object cannot be null.

The PeerEndPoint object has been disposed.

  • The Guid for the current application does not exist or is empty.

  • Endpoint collection is empty or null.

Remarks

The caller is not required to sign-in to the System.Net.PeerToPeer.Collaboration infrastructure for this method to complete successfully. A PeerInvitationResponse from the invitee is not the same as the invitee accepting the invitation to collaborate. If an invitation is sent to a remote peer that has not installed the application, the invitation is automatically declined.

Notes to Callers

Additional overloads are defined on the Peer class instead of the subclasses PeerContact and PeerNearMe.

Calling this method requires a PermissionState of Unrestricted. This state is created when the peer collaboration session begins.

See also

Applies to

InviteAsync(PeerEndPoint, String, Byte[], PeerApplication, Object)

Begins an asynchronous invitation operation for the specified peerEndPoint to join the specified collaboration PeerApplication sponsored by the sender of the invitation.

public:
 void InviteAsync(System::Net::PeerToPeer::Collaboration::PeerEndPoint ^ peerEndPoint, System::String ^ message, cli::array <System::Byte> ^ invitationData, System::Net::PeerToPeer::Collaboration::PeerApplication ^ applicationToInvite, System::Object ^ userToken);
[System.Security.SecurityCritical]
public void InviteAsync (System.Net.PeerToPeer.Collaboration.PeerEndPoint peerEndPoint, string message, byte[] invitationData, System.Net.PeerToPeer.Collaboration.PeerApplication applicationToInvite, object userToken);
[<System.Security.SecurityCritical>]
override this.InviteAsync : System.Net.PeerToPeer.Collaboration.PeerEndPoint * string * byte[] * System.Net.PeerToPeer.Collaboration.PeerApplication * obj -> unit
Public Sub InviteAsync (peerEndPoint As PeerEndPoint, message As String, invitationData As Byte(), applicationToInvite As PeerApplication, userToken As Object)

Parameters

peerEndPoint
PeerEndPoint

The endpoint or remote peer to which to send the invitation.

message
String

A message to send to the remote peer along with the application invitation. The message can be no more than 255 Unicode characters.

invitationData
Byte[]

A user defined data blob to associate with the invitation. Its size can be no more than 16,384 bytes.

applicationToInvite
PeerApplication

The application for which the invitation is sent.

userToken
Object

User-defined object to pass to the callback of the asynchronous operation. Also used to identify the asynchronous operation for cancellation. This parameter must be specified and is unique across all asynchronous invitation operations in progress.

Attributes

Exceptions

  • UserToken cannot be null.

  • Endpoint specified by peerEndPoint cannot be null.

PeerApplication and PeerEndPoint objects cannot be null.

The PeerEndPoint object has been disposed.

The Id for the current application does not exist or is empty.

Remarks

The caller is not required to sign-in to the System.Net.PeerToPeer.Collaboration infrastructure for this method to complete successfully. A PeerInvitationResponse from the invitee is not the same as the invitee accepting the invitation to collaborate. If an invitation is sent to a remote peer that has not installed the application, the invitation is automatically declined.

Notes to Callers

Additional overloads are defined on the Peer class instead of the subclasses PeerContact and PeerNearMe.

Calling this method requires a PermissionState of Unrestricted. This state is created when the peer collaboration session begins.

See also

Applies to