RemoteSystemSessionInfo
RemoteSystemSessionInfo
RemoteSystemSessionInfo
RemoteSystemSessionInfo
Class
Definition
Contains identifying information about a remote session.
public : sealed class RemoteSystemSessionInfo : IRemoteSystemSessionInfopublic sealed class RemoteSystemSessionInfo : IRemoteSystemSessionInfoPublic NotInheritable Class RemoteSystemSessionInfo Implements IRemoteSystemSessionInfo// You can use this class in JavaScript.
- Attributes
| 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 full process of discovering a remote session (including obtaining a reference to a RemoteSystemSessionInfo instance).
// Discover an existing shared experience.
public void DiscoverExistingSessions() {
// create a watcher for remote system sessions
RemoteSystemSessionWatcher sessionWatcher = RemoteSystemSession.CreateWatcher();
// register a handler for the "added" event
sessionWatcher.Added += async (sender, args) => {
// get a reference to the info about the discovered session
RemoteSystemSessionInfo sessionInfo = args.RemoteSystemSessionInfo;
// update the UI with the sessionInfo.DisplayName and
// sessionInfo.ControllerDisplayName strings. Save a reference to
// this RemoteSystemSessionInfo, to use when the user selects
// this session from the UI
//...
};
// Begin watching
sessionWatcher.Start();
}
Once a RemoteSystemSessionInfo reference has be acquired, it can be used to issue a join request. See the code example below for the process of joining a remote session.
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
A session that has been joined is represented by a RemoteSystemSession object. A session that is known about but has not been joined is represented by a RemoteSystemSessionInfo object.
Properties
ControllerDisplayName ControllerDisplayName ControllerDisplayName ControllerDisplayName
Gets the machine name of the device that is the controller of the remote session.
public : PlatForm::String ControllerDisplayName { get; }public string ControllerDisplayName { get; }Public ReadOnly Property ControllerDisplayName As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The machine name of the controller device.
DisplayName DisplayName DisplayName DisplayName
Gets the public-facing name for the remote session, given by the controller of the session.
public : PlatForm::String DisplayName { get; }public string DisplayName { get; }Public ReadOnly Property DisplayName As string// You can use this property in JavaScript.
- Value
- PlatForm::String string string string
The display name for the session.
Methods
JoinAsync() JoinAsync() JoinAsync() JoinAsync()
Issues a request from the calling device to join the given remote session.
public : IAsyncOperation<RemoteSystemSessionJoinResult> JoinAsync()public IAsyncOperation<RemoteSystemSessionJoinResult> JoinAsync()Public Function JoinAsync() As IAsyncOperation( Of RemoteSystemSessionJoinResult )// You can use this method in JavaScript.
An asynchronous operation with the result of this join request. This also returns a value if the connection to the device controlling the session is lost.