Compartir a través de


IsolatedWindowsEnvironmentUserInfo.TryWaitForSignInWithProgressAsync Método

Definición

Desusado. Función asincrónica que permite a los llamadores esperar a que el proceso de inicio de sesión del entorno se complete antes de continuar. Esta función proporciona actualizaciones de progreso a medida que espera el inicio de sesión; TryWaitForSignInAsync no.

public:
 virtual IAsyncOperationWithProgress<bool, IsolatedWindowsEnvironmentSignInProgress> ^ TryWaitForSignInWithProgressAsync() = TryWaitForSignInWithProgressAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperationWithProgress<bool, IsolatedWindowsEnvironmentSignInProgress> TryWaitForSignInWithProgressAsync();
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Deprecated("IsolatedWindowsEnvironmentUserInfo is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 327680, "Windows.Security.Isolation.IsolatedWindowsEnvironmentContract")]
IAsyncOperationWithProgress<bool, IsolatedWindowsEnvironmentSignInProgress> TryWaitForSignInWithProgressAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperationWithProgress<bool,IsolatedWindowsEnvironmentSignInProgress> TryWaitForSignInWithProgressAsync();
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Deprecated("IsolatedWindowsEnvironmentUserInfo is deprecated and might not work on all platforms. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 327680, "Windows.Security.Isolation.IsolatedWindowsEnvironmentContract")]
public IAsyncOperationWithProgress<bool,IsolatedWindowsEnvironmentSignInProgress> TryWaitForSignInWithProgressAsync();
function tryWaitForSignInWithProgressAsync()
Public Function TryWaitForSignInWithProgressAsync () As IAsyncOperationWithProgress(Of Boolean, IsolatedWindowsEnvironmentSignInProgress)

Devoluciones

Operación asincrónica que devuelve un valor booleano que indica si el inicio de sesión se realizó correctamente y un valor de progreso que indica el progreso actual de la operación de inicio de sesión.

Atributos

Requisitos de Windows

Familia de dispositivos
Windows 11 Insider Preview (se introdujo en la versión 10.0.23504.0)
API contract
Windows.Security.Isolation.IsolatedWindowsEnvironmentContract (se introdujo en la versión v4.0)

Ejemplos

En el ejemplo siguiente se obtiene un entorno aislado por su identificador e intenta iniciar sesión con TryWaitForSignInWithProgressAsync mientras se comprueba el progreso de la operación de inicio de sesión.

void GetEnvironmentSignInInfo()
{
    auto environment = IsolatedWindowsEnvironment::GetById(environmentId);

    if (!environment)
    {
        LogMessage(L"Environment does not exist.");
        return;
    }

    auto result = environment.GetUserInfo();

    if (!result)
    {
        LogMessage(L"Failed to initialize GetUserInfo – verify that the environment exists.");
        return;
    }

    auto operation = result.TryWaitForSignInWithProgressAsync();

    operation.Progress([&](auto const&, IsolatedWindowsEnvironmentSignInProgress progress)
    {
        switch (progress)
        {
            case IsolatedWindowsEnvironmentSignInProgress::Connecting:
                UpdateProgressDialogUI(L"Connecting to isolated environment.");
                break;
            case IsolatedWindowsEnvironmentSignInProgress::Connected:
                UpdateProgressDialogUI(L"Established connection to isolated environment.");
                break;
            case IsolatedWindowsEnvironmentSignInProgress::Authenticating:
                UpdateProgressDialogUI(L"Signing in to isolated environment.");
                break;
            case IsolatedWindowsEnvironmentSignInProgress::SettingUpAccount:
                UpdateProgressDialogUI(L"Setting up user session.");
                break;
            case IsolatedWindowsEnvironmentSignInProgress::Finalizing:
                UpdateProgressDialogUI(L"Configuring user session settings.");
                break;
            case IsolatedWindowsEnvironmentSignInProgress::Completed:
                UpdateProgressDialogUI(L"Sign-in is complete.");
                break;
            default:
                LogMessage(L"Encountered an unknown progress state, this is unexpected. Do not update UI dialog.\n");
        }
    });
}

Comentarios

Advertencia

Se trata de una API en desuso.

Se aplica a

Consulte también