RemoteSystemSessionJoinRequestedEventArgs 클래스

정의

발생한 RemoteSystemSessionController.JoinRequested 이벤트에 대한 정보를 포함합니다.

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

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

설명

이 클래스는 RemoteSystemSessionController.JoinRequested 이벤트가 발생할 때마다 인스턴스화되며 이 이벤트에 등록된 메서드에서 처리해야 합니다.

속성

JoinRequest

들어오는 요청을 나타내는 RemoteSystemSessionJoinRequest 를 가져옵니다.

메서드

GetDeferral()

이 작업에 대한 지연 개체를 가져옵니다.

적용 대상