RemoteSystemSessionInfo 클래스

정의

원격 세션에 대한 식별 정보를 포함합니다.

public ref class RemoteSystemSessionInfo 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 RemoteSystemSessionInfo final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 262144)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class RemoteSystemSessionInfo 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 RemoteSystemSessionInfo
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 262144)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class RemoteSystemSessionInfo
Public NotInheritable Class RemoteSystemSessionInfo
상속
Object Platform::Object IInspectable RemoteSystemSessionInfo
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 Creators Update (10.0.15063.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v4.0에서 도입되었습니다.)
앱 기능
remoteSystem

예제

원격 세션을 검색하는 전체 프로세스(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();
}

RemoteSystemSessionInfo 참조를 가져오면 조인 요청을 발급하는 데 사용할 수 있습니다. 원격 세션에 참가하는 프로세스는 아래 코드 예제를 참조하세요.

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.Session;

        // 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
    }
}

설명

조인된 세션은 RemoteSystemSession 개체로 표시됩니다. 에 대해 알려져 있지만 조인되지 않은 세션은 RemoteSystemSessionInfo 개체로 표시됩니다.

속성

ControllerDisplayName

원격 세션의 컨트롤러인 디바이스의 컴퓨터 이름을 가져옵니다.

DisplayName

세션의 컨트롤러가 지정한 원격 세션의 공용 이름을 가져옵니다.

메서드

JoinAsync()

호출 디바이스에서 지정된 원격 세션에 참가하라는 요청을 발급합니다.

적용 대상