RemoteSystemSession.CreateWatcher 메서드

정의

RemoteSystemSessionWatcher 개체를 초기화하고 반환하여 원격 세션의 존재를 모니터링합니다.

public:
 static RemoteSystemSessionWatcher ^ CreateWatcher();
 static RemoteSystemSessionWatcher CreateWatcher();
public static RemoteSystemSessionWatcher CreateWatcher();
function createWatcher()
Public Shared Function CreateWatcher () As RemoteSystemSessionWatcher

반환

원격 세션을 검색하는 데 사용할 감시자 개체입니다.

Windows 요구 사항

앱 기능
remoteSystem

예제

원격 세션을 검색하는 프로세스는 아래 코드 예제를 참조하세요.

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

적용 대상