Peer.InviteAsync Peer.InviteAsync Peer.InviteAsync Peer.InviteAsync Method

定義

開始非同步邀請作業,這樣會傳送邀請給 Peer 以啟動特定的 PeerApplicationBegins an asynchronous invitation operation which sends an invitation to a Peer to start a specific PeerApplication.

多載

InviteAsync(Object) InviteAsync(Object) InviteAsync(Object) InviteAsync(Object)

開始非同步邀請作業,這樣會傳送邀請給 Peer 以啟動特定的 PeerApplicationBegins an asynchronous invitation operation which sends an invitation to a Peer to start a specific PeerApplication.

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

開始非同步邀請作業,這樣會傳送邀請給 Peer 以啟動特定的 PeerApplicationBegins an asynchronous invitation operation which sends an invitation to a Peer to start a specific PeerApplication.

InviteAsync(Object) InviteAsync(Object) InviteAsync(Object) InviteAsync(Object)

開始非同步邀請作業,這樣會傳送邀請給 Peer 以啟動特定的 PeerApplicationBegins an asynchronous invitation operation which sends an invitation to a Peer to start a specific PeerApplication.

public:
 abstract void InviteAsync(System::Object ^ userToken);
public abstract void InviteAsync (object userToken);
abstract member InviteAsync : obj -> unit
Public MustOverride Sub InviteAsync (userToken As Object)

參數

userToken
Object Object Object Object

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

例外狀況

- 邀請期間發生錯誤。- An error occurred during the invitation process.

- 目前執行的應用程式未向共同作業基礎結構註冊。- The currently executing application is not registered with the collaboration infrastructure.

備註

呼叫這個方法需要PermissionStateUnrestrictedCalling this method requires a PermissionState of Unrestricted. 對等共同作業工作階段開始時,會建立此狀態。This state is created when the peer collaboration session begins.

另請參閱

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

開始非同步邀請作業,這樣會傳送邀請給 Peer 以啟動特定的 PeerApplicationBegins an asynchronous invitation operation which sends an invitation to a Peer to start a specific PeerApplication.

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

參數

applicationToInvite
PeerApplication PeerApplication PeerApplication PeerApplication

邀請會傳送給 PeerApplicationThe PeerApplication for which the invitation is sent.

message
String String String String

要隨應用程式邀請傳送到遠端對等的訊息。A message to send to the remote peer along with the application invitation. 此訊息的大小上限是 255 個 Unicode 字元。The maximum size of this message is 255 Unicode characters.

invitationData
Byte[]

使用者定義的資料 Blob,用於與邀請建立關聯。A user defined data blob to associate with the invitation. 大小可超過 16,384 個位元組。Its size can be no more than 16,384 bytes.

userToken
Object Object Object Object

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

例外狀況

應用程式未向協同作業基礎結構註冊。The application is not registered with the collaboration infrastructure.

invitationData 大於 16,384 個位元組。invitationData is larger than 16,384 bytes.

- 邀請期間發生錯誤。- An error occurred during the invitation process.

- 目前執行的應用程式未向共同作業基礎結構註冊。- The currently executing application is not registered with the collaboration infrastructure.

備註

呼叫這個方法需要PermissionStateUnrestrictedCalling this method requires a PermissionState of Unrestricted. 對等共同作業工作階段開始時,會建立此狀態。This state is created when the peer collaboration session begins.

另請參閱

適用於