共用方式為


RemoteSystemSessionInvitation 類別

定義

代表來自會話參與者的邀請,以加入其遠端會話。

public ref class RemoteSystemSessionInvitation sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class RemoteSystemSessionInvitation final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RemoteSystemSessionInvitation final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class RemoteSystemSessionInvitation
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RemoteSystemSessionInvitation
Public NotInheritable Class RemoteSystemSessionInvitation
繼承
Object Platform::Object IInspectable RemoteSystemSessionInvitation
屬性

Windows 需求

裝置系列
Windows 10 Creators Update (已於 10.0.15063.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v4.0 引進)
應用程式功能
remoteSystem

範例

如需如何接收及處理遠端會話邀請的範例,請參閱下列程式碼。

public void SubscribeAndHandleInvites() {
    var invitationListener = new RemoteSystemSessionInvitationListener();

    // register the following code to handle this event:
    invitationListener.InvitationReceived += async (sender, args) => {

        // issue a join request to the session
        RemoteSystemSessionJoinResult joinResult = await args.Invitation.RemoteSystemSessionInfo.JoinAsync();

        // handle the join result as in the normal session discovery scenario
        // ...
    };
}

備註

這個類別的實例包含在 RemoteSystemSessionInvitationReceivedEventArgs 物件中,該物件是使用 RemoteSystemSessionInvitationListener.InvitationReceived 事件傳入。

接收邀請的裝置必須使用 RemoteSystemSessionInvitationListener 來處理它。

屬性

Sender

取得 RemoteSystem 物件,表示傳送邀請的裝置。

SessionInfo

會取得 RemoteSystemSessionInfo 物件,代表此裝置受邀的會話。

適用於