private void ShutdownHelper(ShutdownKind kind) { new System.Threading.Tasks.Task(() => { ShutdownManager.BeginShutdown(kind, TimeSpan.FromSeconds(0)); }).Start(); }
private void ShutdownHelper(ShutdownKind kind) { try { ShutdownManager.BeginShutdown(kind, TimeSpan.FromSeconds(0.5)); } catch (Exception ex) { } }
public async void ShowPowerDialog(ShutdownKind kind) { var dialog = (kind == ShutdownKind.Restart ? RestartDialog : ShutdownDialog); var result = await dialog.ShowAsync(); if (result == ContentDialogResult.Primary && IsIoTDeviceFamily) { await CommService.DisconnectAsync(); ShutdownManager.BeginShutdown(kind, TimeSpan.FromSeconds(0)); } }
private void ShutdownHelper(ShutdownKind kind) { try { ShutdownManager.BeginShutdown(kind, TimeSpan.FromSeconds(0.5)); } catch (Exception e) { // Catching the exception ensures this doesn't crash the app on non-IOT devices Debug.WriteLine("Couldn't begin shutdown: " + e.Message); } }
private void ShutdownHelper(ShutdownKind kind) { ShutdownManager.BeginShutdown(kind, TimeSpan.FromSeconds(0.5)); }