RemoteSystemSessionJoinRequest RemoteSystemSessionJoinRequest RemoteSystemSessionJoinRequest RemoteSystemSessionJoinRequest Class

Definition

Represents a remote device's request to join a session controlled by this device.

public : sealed class RemoteSystemSessionJoinRequest : IRemoteSystemSessionJoinRequestpublic sealed class RemoteSystemSessionJoinRequest : IRemoteSystemSessionJoinRequestPublic NotInheritable Class RemoteSystemSessionJoinRequest Implements IRemoteSystemSessionJoinRequest// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Examples

See the following code for an example of how to create a remote session and handle join requests.


public async void StartNewSharedExperience() {

    var manager = new RemoteSystemSessionController("Bob’s Minecraft game");

    // register the following code to handle the JoinRequested event
    manager.JoinRequested += async (sender, args) => {
        // Get the deferral
        var deferral = args.GetDeferral();

        // display the participant (args.JoinRequest.Participant) on UI, giving the 
        // user an opportunity to respond
        // ...

        // If the user chooses "accept", accept this remote system as a participant
        args.JoinRequest.Accept();
    };

    // create and start the session
    RemoteSystemSessionCreationResult createResult = await manager.CreateSessionAsync();

    // handle the creation result
    if (createResult.Status == RemoteSystemSessionCreateStatus.Success) {
        // creation was successful
        RemoteSystemSession currentSession = createResult.RemoteSystemSession;

        // optionally subscribe to the disconnection event
        currentSession.Disconnected += async (sender, args) => {
            // update the UI, using args.Reason
            // ...
        };

        // Use session ...

    } else if (createResult.Status == RemoteSystemSessionCreateStatus.SessionLimitsExceeded) {
        // creation failed. Optionally update UI to indicate that there are too many sessions in progress
    } else {
        // creation failed for an unknown reason. Optionally update UI
    }
}

Properties

Participant Participant Participant Participant

Describes a request by a remote device to join a remote session.

public : RemoteSystemSessionParticipant Participant { get; }public RemoteSystemSessionParticipant Participant { get; }Public ReadOnly Property Participant As RemoteSystemSessionParticipant// You can use this property in JavaScript.

Methods

Accept() Accept() Accept() Accept()

Causes the app to accept the requesting device into the remote session it is controlling.

public : void Accept()public void Accept()Public Function Accept() As void// You can use this method in JavaScript.

Remarks

When this method is called, the device in question (described by the RemoteSystemSessionJoinRequest.Participant property) will receive back a RemoteSystemSessionJoinResult object with a reference to the remote session that it attempted to join.