IsolatedWindowsEnvironmentUserInfo.TryWaitForSignInWithProgressAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Deprecated. An asynchronous function which allows callers to wait for the environment sign-in process to complete before continuing. This function provides progress updates as it waits for sign-in; TryWaitForSignInAsync does not.
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)
Returns
IAsyncOperationWithProgress<Boolean,IsolatedWindowsEnvironmentSignInProgress>
IAsyncOperationWithProgress<bool,IsolatedWindowsEnvironmentSignInProgress>
An asynchronous operation which returns a boolean value indicating whether sign-in was successful, and a progress value indicating the current progress of the sign-in operation.
- Attributes
Windows requirements
Device family |
Windows 11 Insider Preview (introduced in 10.0.23504.0)
|
API contract |
Windows.Security.Isolation.IsolatedWindowsEnvironmentContract (introduced in v4.0)
|
Examples
The following example gets an isolated environment by its Id and attempts to sign in using TryWaitForSignInWithProgressAsync
while checking the progress of the sign in operation.
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");
}
});
}
Remarks
Warning
This is a deprecated API.