Peer.InviteAsyncCancel(Object) Peer.InviteAsyncCancel(Object) Peer.InviteAsyncCancel(Object) Peer.InviteAsyncCancel(Object) Method

定義

取消使用 InviteAsync(PeerApplication, String, Byte[], Object) 方法傳送的邀請。Cancels the invitation that was sent with the InviteAsync(PeerApplication, String, Byte[], Object) method.

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

參數

userToken
Object Object Object Object

使用者定義的物件,用於傳遞至 InviteAsync(PeerApplication, String, Byte[], Object)作業的回呼以供識別。User defined object to pass to the callback of the InviteAsync(PeerApplication, String, Byte[], Object) operation for identification. 此必要參數在進行中的所有非同步邀請作業中必須是唯一的。This required parameter must be unique across all asynchronous invitation operations in progress.

例外狀況

userToken 參數不可為 null.The userToken parameter cannot be null.

已處理非同步邀請。An asynchronous invitation is not outstanding.

備註

呼叫這個方法可確保系統會停止等待PeerInvitationResponse與 InviteAsync 要求相關聯的對等。Calling this method guarantees the system will cease to wait for a PeerInvitationResponse from the peer associated with the InviteAsync request.

在任何指定的時間, 可能會有多個邀請未完成。Multiple invitations may be outstanding at any given time. 如果在InviteAsyncCanceluserToken識別的非同步作業不存在時呼叫此方法, 則會擲回例外狀況。If the InviteAsyncCancel method is called when an asynchronous operation identified by the userToken is not in existence, an exception is thrown. 必須userToken提供物件, 因為它是用來追蹤特定的非同步呼叫。The userToken object must be provided since it is used to track a specific asynchronous call. 此主機應用程式提供的物件對於每個邀請要求都是唯一的。This host application-supplied object is unique for each invite request.

使用這個方法時, InviteCompleted仍然可以引發事件, 但相關InviteCompletedEventArgs物件上的 [已取消] 屬性會設定為true.When this method is used, the InviteCompleted event can still be raised, but the Cancelled property on the associated InviteCompletedEventArgs object will be set to true.

呼叫這個方法需要PermissionState的。 UnrestrictedCalling this method requires a PermissionState of Unrestricted.

適用於

另請參閱