RemoteSystemSessionDisconnectedEventArgs
RemoteSystemSessionDisconnectedEventArgs
RemoteSystemSessionDisconnectedEventArgs
RemoteSystemSessionDisconnectedEventArgs
Class
Definition
Contains information about a RemoteSystemSession.Disconnected event, namely the reason that this device was disconnected from the session.
public : sealed class RemoteSystemSessionDisconnectedEventArgs : IRemoteSystemSessionDisconnectedEventArgspublic sealed class RemoteSystemSessionDisconnectedEventArgs : IRemoteSystemSessionDisconnectedEventArgsPublic NotInheritable Class RemoteSystemSessionDisconnectedEventArgs Implements IRemoteSystemSessionDisconnectedEventArgs// 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 code example below for the process of joining a remote session (including using a RemoteSystemSessionDisconnectedEventArgs instance).
public async void JoinExistingSession() {
// request to join. sessionInfo has already been selected by user.
RemoteSystemSessionJoinResult joinResult = await sessionInfo.JoinAsync();
// process the result
if (joinResult.Status == RemoteSystemSessionJoinStatus.Success) {
// if the join was successful, acquire a reference to the session
currentSession = joinResult.RemoteSystemSession;
// optionally handle the disconnected event
currentSession.Disconnected += async (sender, args) => {
// update the UI, using args.Reason
};
// update the UI with the session.DisplayName and
// session.ControllerDisplayName strings. Save a reference to
// this RemoteSystemSession, to use when the user selects
// this session from the UI
} else {
// join request failed. optionally update UI
}
}
Remarks
This class is instantiated whenever the RemoteSystemSession.Disconnected event is raised, and it should be handled by the method(s) registered to this event.
Properties
Reason Reason Reason Reason
Gets the reason this device was disconnected from the session.
public : RemoteSystemSessionDisconnectedReason Reason { get; }public RemoteSystemSessionDisconnectedReason Reason { get; }Public ReadOnly Property Reason As RemoteSystemSessionDisconnectedReason// You can use this property in JavaScript.
- Value
- RemoteSystemSessionDisconnectedReason RemoteSystemSessionDisconnectedReason RemoteSystemSessionDisconnectedReason RemoteSystemSessionDisconnectedReason
The RemoteSystemSessionDisconnectedReason value representing the reason for disconnection.