Share via


RemoteSystemSessionInvitationListener Klasse

Definition

Enthält die Funktionalität zum Empfangen und Verarbeiten von Einladungen zum Beitreten an Remotesitzungen. Diese Klasse beginnt mit dem Lauschen auf Einladungen, wenn sie instanziiert wird.

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
Vererbung
Object Platform::Object IInspectable RemoteSystemSessionInvitationListener
Attribute

Windows-Anforderungen

Gerätefamilie
Windows 10 Creators Update (eingeführt in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (eingeführt in v4.0)
App-Funktionen
remoteSystem

Beispiele

Im folgenden Code finden Sie ein Beispiel für das Empfangen und Verarbeiten von Remotesitzungseinladungen.

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

Hinweise

Wichtig

Sie müssen den Zugriff auf die Remotesystemplattform mit einem Aufruf von RemoteSystem.RequestAccessAsync bestätigen, bevor Sie Handler für die Ereignisse dieser Klasse einrichten.

Konstruktoren

RemoteSystemSessionInvitationListener()

Initialisiert eine instance von RemoteSystemSessionInvitationListener.

Ereignisse

InvitationReceived

Wird ausgelöst, wenn eine Remotesitzungseinladung von einem anderen Gerät erkannt wurde.

Gilt für: