RemoteSystemSessionWatcher RemoteSystemSessionWatcher RemoteSystemSessionWatcher RemoteSystemSessionWatcher Class

Definition

Watches for activity related to the discovery of remote sessions and raises the appropriate events.

public : sealed class RemoteSystemSessionWatcher : IRemoteSystemSessionWatcherpublic sealed class RemoteSystemSessionWatcher : IRemoteSystemSessionWatcherPublic NotInheritable Class RemoteSystemSessionWatcher Implements IRemoteSystemSessionWatcher// 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 discovering a remote session.


// 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();
}

Remarks

This class is instantiated when the RemoteSystemSession.CreateWatcher method is called.

Properties

Status Status Status Status

Gets the operational status of this remote session watcher.

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

Methods

Start() Start() Start() Start()

Starts watching for discoverable remote sessions. The discovery process runs until the Stop method is called. A RemoteSystemSessionWatcher object can have its Start method called again at a later time.

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

Stop() Stop() Stop() Stop()

Stops watching for discoverable remote sessions.

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

Events

Added Added Added Added

Raised when a new remote session has been discovered by the RemoteSystemSessionWatcher.

public : event TypedEventHandler Added<RemoteSystemSessionWatcher,  RemoteSystemSessionAddedEventArgs>public event TypedEventHandler Added<RemoteSystemSessionWatcher,  RemoteSystemSessionAddedEventArgs>Public Event Added<RemoteSystemSessionWatcher,  RemoteSystemSessionAddedEventArgs>// You can use this event in JavaScript.

Removed Removed Removed Removed

Raised when a previously discovered remote session has disappeared.

public : event TypedEventHandler Removed<RemoteSystemSessionWatcher,  RemoteSystemSessionRemovedEventArgs>public event TypedEventHandler Removed<RemoteSystemSessionWatcher,  RemoteSystemSessionRemovedEventArgs>Public Event Removed<RemoteSystemSessionWatcher,  RemoteSystemSessionRemovedEventArgs>// You can use this event in JavaScript.

Updated Updated Updated Updated

Raised when a previously discovered remote session has some part of its information updated.

public : event TypedEventHandler Updated<RemoteSystemSessionWatcher,  RemoteSystemSessionUpdatedEventArgs>public event TypedEventHandler Updated<RemoteSystemSessionWatcher,  RemoteSystemSessionUpdatedEventArgs>Public Event Updated<RemoteSystemSessionWatcher,  RemoteSystemSessionUpdatedEventArgs>// You can use this event in JavaScript.