RemoteSystemSessionInvitationListener Kelas

Definisi

Berisi fungsionalitas untuk menerima dan menangani undangan untuk bergabung dengan sesi jarak jauh. Kelas ini mulai mendengarkan undangan saat dibuat.

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
Warisan
Object Platform::Object IInspectable RemoteSystemSessionInvitationListener
Atribut

Persyaratan Windows

Rangkaian perangkat
Windows 10 Creators Update (diperkenalkan dalam 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (diperkenalkan dalam v4.0)
Kemampuan aplikasi
remoteSystem

Contoh

Lihat kode berikut untuk contoh cara menerima dan menangani undangan sesi jarak jauh.

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

Keterangan

Penting

Anda harus mengonfirmasi akses ke platform sistem jarak jauh dengan panggilan ke RemoteSystem.RequestAccessAsync sebelum Anda menyiapkan handler untuk peristiwa kelas ini.

Konstruktor

RemoteSystemSessionInvitationListener()

Menginisialisasi instans RemoteSystemSessionInvitationListener.

Acara

InvitationReceived

Dimunculkan ketika undangan sesi jarak jauh dari perangkat lain telah terdeteksi.

Berlaku untuk