RemoteSystemSessionController 클래스

정의

다른 디바이스가 조인할 새 원격 세션의 생성 및 관리를 처리합니다.

public ref class RemoteSystemSessionController sealed
/// [Windows.Foundation.Metadata.Activatable(Windows.System.RemoteSystems.IRemoteSystemSessionControllerFactory, 262144, "Windows.Foundation.UniversalApiContract")]
/// [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 RemoteSystemSessionController final
[Windows.Foundation.Metadata.Activatable(typeof(Windows.System.RemoteSystems.IRemoteSystemSessionControllerFactory), 262144, "Windows.Foundation.UniversalApiContract")]
[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 RemoteSystemSessionController
function RemoteSystemSessionController(displayName, options)
Public NotInheritable Class RemoteSystemSessionController
상속
Object Platform::Object IInspectable RemoteSystemSessionController
특성

Windows 요구 사항

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

예제

원격 세션을 만들고 조인 요청을 처리하는 방법에 대한 예제는 다음 코드를 참조하세요.

public async void StartNewSharedExperience() {

    var manager = new RemoteSystemSessionController("Bob’s Minecraft game");

    // register the following code to handle the JoinRequested event
    manager.JoinRequested += async (sender, args) => {
        // Get the deferral
        var deferral = args.GetDeferral();

        // display the participant (args.JoinRequest.Participant) on UI, giving the 
        // user an opportunity to respond
        // ...

        // If the user chooses "accept", accept this remote system as a participant
        args.JoinRequest.Accept();
    };

    // create and start the session
    RemoteSystemSessionCreationResult createResult = await manager.CreateSessionAsync();

    // handle the creation result
    if (createResult.Status == RemoteSystemSessionCreationStatus.Success) {
        // creation was successful
        RemoteSystemSession currentSession = createResult.Session;

        // optionally subscribe to the disconnection event
        currentSession.Disconnected += async (sender, args) => {
            // update the UI, using args.Reason
            // ...
        };

        // Use session ...

    } else if (createResult.Status == RemoteSystemSessionCreationStatus.SessionLimitsExceeded) {
        // creation failed. Optionally update UI to indicate that there are too many sessions in progress
    } else {
        // creation failed for an unknown reason. Optionally update UI
    }
}

설명

모든 원격 세션에는 세션의 컨트롤러인 하나의 참가자가 있습니다. 컨트롤러만 세션에 대한 옵션을 지정하고, 참가자의 참가 요청을 수락하고, 세션에서 참가자를 제거할 수 있습니다.

중요

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

생성자

RemoteSystemSessionController(String)

사용자 지정 표시 이름을 사용하여 RemoteSystemSessionController 를 초기화합니다.

RemoteSystemSessionController(String, RemoteSystemSessionOptions)

사용자 지정 표시 이름 및 지정된 옵션을 사용하여 RemoteSystemSessionController 를 초기화합니다.

메서드

CreateSessionAsync()

원격 세션을 비동기적으로 만들려고 시도합니다.

RemoveParticipantAsync(RemoteSystemSessionParticipant)

원격 세션에서 참가자를 제거합니다.

이벤트

JoinRequested

다른 디바이스가 이 RemoteSystemSessionController에서 관리하는 원격 세션에 대한 액세스를 검색하고 요청할 때마다 발생합니다.

적용 대상