RemoteSystemSessionWatcher 클래스

정의

원격 세션 검색과 관련된 활동을 감시하고 적절한 이벤트를 발생합니다.

public ref class RemoteSystemSessionWatcher sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class RemoteSystemSessionWatcher final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RemoteSystemSessionWatcher final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class RemoteSystemSessionWatcher
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RemoteSystemSessionWatcher
Public NotInheritable Class RemoteSystemSessionWatcher
상속
Object Platform::Object IInspectable RemoteSystemSessionWatcher
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 Creators Update (10.0.15063.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v4.0에서 도입되었습니다.)
앱 기능
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();
}

설명

이 클래스는 RemoteSystemSession.CreateWatcher 메서드가 호출될 때 인스턴스화됩니다.

중요

이 클래스를 인스턴스화하기 전에 RemoteSystem.RequestAccessAsync 를 호출하여 원격 시스템 플랫폼에 대한 액세스를 확인해야 합니다.

중요

원격 세션 검색이 의도한 대로 작동하려면 다음 조건을 충족해야 합니다.

  1. 클라이언트 및 호스트 디바이스 모두에 대해 Bluetooth를 켜야 합니다. 세션 검색은 LAN 검색을 통해 작동할 수 있지만 보장되지는 않습니다(네트워크 구성에 따라 다름).
  2. 호스트 디바이스의 설정 앱에서 시스템 -> 공유 환경 아래의 디바이스 간 공유 설정은 "근처의 모든 사람"으로 설정해야 합니다.
  3. 클라이언트 및 호스트 앱에는 동일한 PackageFamilyName이 있어야 합니다.

속성

Status

이 원격 세션 감시자의 운영 상태 가져옵니다.

메서드

Start()

검색 가능한 원격 세션에 대한 감시를 시작합니다. 검색 프로세스는 Stop 메서드가 호출될 때까지 실행됩니다. RemoteSystemSessionWatcher 개체는 나중에 Start 메서드를 다시 호출할 수 있습니다.

Stop()

검색 가능한 원격 세션에 대한 감시를 중지합니다.

이벤트

Added

RemoteSystemSessionWatcher에서 새 원격 세션을 검색할 때 발생합니다.

Removed

이전에 검색한 원격 세션이 사라지면 발생합니다.

Updated

이전에 검색된 원격 세션의 일부 정보가 업데이트되었을 때 발생합니다.

적용 대상