RemoteSystemSessionInvitationListener クラス

定義

リモート セッションに参加するための招待を受信および処理するための機能が含まれています。 このクラスは、インスタンス化されると、招待のリッスンを開始します。

public ref class RemoteSystemSessionInvitationListener sealed
/// [Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
/// [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 RemoteSystemSessionInvitationListener final
[Windows.Foundation.Metadata.Activatable(262144, "Windows.Foundation.UniversalApiContract")]
[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 RemoteSystemSessionInvitationListener
function RemoteSystemSessionInvitationListener()
Public NotInheritable Class RemoteSystemSessionInvitationListener
継承
Object Platform::Object IInspectable RemoteSystemSessionInvitationListener
属性

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
        // ...
    };
}

注釈

重要

このクラスのイベントのハンドラーを設定する前に、 RemoteSystem.RequestAccessAsync を呼び出してリモート システム プラットフォームへのアクセスを確認する必要があります。

コンストラクター

RemoteSystemSessionInvitationListener()

RemoteSystemSessionInvitationListener のインスタンスを初期化します。

イベント

InvitationReceived

別のデバイスからのリモート セッション招待が検出されたときに発生します。

適用対象