RemoteSystemSession.CreateWatcher Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes and returns a RemoteSystemSessionWatcher object to monitor the presence of remote sessions.
public:
static RemoteSystemSessionWatcher ^ CreateWatcher();
static RemoteSystemSessionWatcher CreateWatcher();
public static RemoteSystemSessionWatcher CreateWatcher();
function createWatcher()
Public Shared Function CreateWatcher () As RemoteSystemSessionWatcher
A watcher object to be used in discovering remote sessions.
App capabilities |
remoteSystem
|
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();
}
Product | Versions |
---|---|
WinRT | Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |