/// <summary> /// When the application is about to enter a suspended state, save the user edited properties text. /// This method does not use the SuspensionManager helper class (defined in SuspensionManager.cs). /// </summary> private void SaveDataToPersistedState(object sender, SuspendingEventArgs args) { // Only save state if we have valid data. if (m_fileToken != null) { // Requesting a deferral prevents the application from being immediately suspended. SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral(); // LocalSettings does not support overwriting existing items, so first clear the collection. ResetPersistedState(); m_localSettings.Add("scenario2FileToken", m_fileToken); m_localSettings.Add("scenario2Width", m_displayWidthNonScaled); m_localSettings.Add("scenario2Height", m_displayHeightNonScaled); m_localSettings.Add("scenario2Scale", m_scaleFactor); m_localSettings.Add("scenario2UserRotation", Helpers.ConvertToExifOrientationFlag(m_userRotation) ); m_localSettings.Add("scenario2ExifOrientation", Helpers.ConvertToExifOrientationFlag(m_exifOrientation) ); m_localSettings.Add("scenario2DisableExif", m_disableExifOrientation); deferral.Complete(); } }
/// <summary> /// 在将要挂起应用程序执行时调用。 在不知道应用程序 /// 无需知道应用程序会被终止还是会恢复, /// 并让内存内容保持不变。 /// </summary> /// <param name="sender">挂起的请求的源。</param> /// <param name="e">有关挂起请求的详细信息。</param> private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); //TODO: 保存应用程序状态并停止任何后台活动 deferral.Complete(); }
/// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); }
async protected void AppSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); await GlobalNodeHandler.settings.autoSaveMap(); deferral.Complete(); }
private void CoreApplication_Suspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); //game.Dispose(); deferral.Complete(); }
/// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private async void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); await SuspensionManager.SaveAsync(); deferral.Complete(); }
async void OnAppSuspending(object sender, SuspendingEventArgs args) { SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral(); // Save current document StorageFolder localFolder = ApplicationData.Current.LocalFolder; try { StorageFile storageFile = await localFolder.CreateFileAsync("RichTextEditor.rtf", CreationCollisionOption.ReplaceExisting); IRandomAccessStream stream = await storageFile.OpenAsync(FileAccessMode.ReadWrite); richEditBox.Document.SaveToStream(TextGetOptions.FormatRtf, stream); } catch { // Ignore exceptions here } // Save selection settings IPropertySet propertySet = ApplicationData.Current.LocalSettings.Values; propertySet["SelectionStart"] = richEditBox.Document.Selection.StartPosition; propertySet["SelectionEnd"] = richEditBox.Document.Selection.EndPosition; deferral.Complete(); }
private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); Locator.PlaybackService?.Trim(); deferral.Complete(); }
/// <summary> /// When the application is about to enter a suspended state, save the user edited properties text. /// </summary> private void SaveDataToPersistedState(object sender, SuspendingEventArgs args) { // Only save state if we have valid data. if (m_fileToken != null) { // Requesting a deferral prevents the application from being immediately suspended. SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral(); // LocalSettings does not support overwriting existing items, so first clear the collection. ResetPersistedState(); m_localSettings.Add("scenario1Title", TitleTextbox.Text); m_localSettings.Add("scenario1Keywords", KeywordsTextbox.Text); m_localSettings.Add("scenario1DateTaken", DateTakenTextblock.Text); m_localSettings.Add("scenario1Make", MakeTextblock.Text); m_localSettings.Add("scenario1Model", ModelTextblock.Text); m_localSettings.Add("scenario1Orientation", OrientationTextblock.Text); m_localSettings.Add("scenario1LatDeg", LatDegTextbox.Text); m_localSettings.Add("scenario1LatMin", LatMinTextbox.Text); m_localSettings.Add("scenario1LatSec", LatSecTextbox.Text); m_localSettings.Add("scenario1LatRef", LatRefTextbox.Text); m_localSettings.Add("scenario1LongDeg", LongDegTextbox.Text); m_localSettings.Add("scenario1LongMin", LongMinTextbox.Text); m_localSettings.Add("scenario1LongSec", LongSecTextbox.Text); m_localSettings.Add("scenario1LongRef", LongRefTextbox.Text); m_localSettings.Add("scenario1Exposure", ExposureTextblock.Text); m_localSettings.Add("scenario1FNumber", FNumberTextblock.Text); m_localSettings.Add("scenario1FileToken", m_fileToken); deferral.Complete(); } }
/// <summary> /// Appelé lorsque l'exécution de l'application est suspendue. L'état de l'application est enregistré /// sans savoir si l'application pourra se fermer ou reprendre sans endommager /// le contenu de la mémoire. /// </summary> /// <param name="sender">Source de la requête de suspension.</param> /// <param name="e">Détails de la requête de suspension.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); //TODO: enregistrez l'état de l'application et arrêtez toute activité en arrière-plan deferral.Complete(); }
async void OnApplicationSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); await Application.Current.SendSleepAsync(); deferral.Complete(); }
private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); _main.OnSuspending(); deferral.Complete(); }
async protected void OnSuspending(object sender, SuspendingEventArgs args) { SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral(); await SuspensionManager.SaveAsync(); deferral.Complete(); }
private void TryCompleteCurrentDeferral() { if (this.deferral != null) { this.deferral.Complete(); this.deferral = null; } }
/// <summary> /// Se invoca al suspender la ejecución de la aplicación. El estado de la aplicación se guarda /// sin saber si la aplicación se terminará o se reanudará con el contenido /// de la memoria aún intacto. /// </summary> /// <param name="sender">Origen de la solicitud de suspensión.</param> /// <param name="e">Detalles sobre la solicitud de suspensión.</param> private async void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); await CleanupCaptureResources(); deferral.Complete(); }
private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); IsForeground = false; NotificationSystem.RefreshCallNotification(CallSystem.CallManager.CurrentCalls); deferral.Complete(); }
/* * /// <summary> * /// Invoked when Navigation to a certain page fails * /// </summary> * /// <param name="sender">The Frame which failed navigation</param> * /// <param name="e">Details about the navigation failure</param> * void OnNavigationFailed(object sender, NavigationFailedEventArgs e) * { * throw new Exception("Failed to load Page " + e.SourcePageType.FullName); * } */ /// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); SaveAppState(); // elmentjük az alkalmazás állapotát deferral.Complete(); }
public async void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); await CleanupAsync(); deferral.Complete(); }
private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); Task saveStateTask = saveStateToDisk().ContinueWith(innerTask => { deferral.Complete(); }); }
void OnSuspending(object sender, SuspendingEventArgs e) { StopLocationTracking(); SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); locationTask.Wait(); deferral.Complete(); }
public async void OnSuspending(SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); await SuspensionManager.SaveAsync(); ContinuationManager.MarkAsStale(); deferral.Complete(); }
//--------------------------------------------------------Events:---------------------------------------------------------------------\\ #region --Events-- private void OnSuspending(object sender, SuspendingEventArgs e) { isRunning = false; SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); deferral.Complete(); }
#pragma warning disable IDE1006 // Naming Styles private async void OnSuspending(object sender, SuspendingEventArgs e) #pragma warning restore IDE1006 // Naming Styles { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); await AppData.Current.SaveAsync(); deferral.Complete(); }
async void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e) { TealiumStatusLog.Information("Application.Current.Suspending"); SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); var throwaway = await StorageHelper.Save(requestQueue.ToList(), "_tealium_queue"); TealiumStatusLog.Information("Queue saved to disk"); deferral.Complete(); //needed to ensure the suspend process waits for this to finish }
/// <summary> /// Invoked when application execution is being suspended. Application state is saved /// without knowing whether the application will be terminated or resumed with the contents /// of memory still intact. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { SettingsPane.GetForCurrentView().CommandsRequested -= App_CommandsRequested; SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); }
public async void OnSuspending(SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); PincodeManager.SavePinTimer(); await SuspensionManager.SaveAsync(); deferral.Complete(); }
/// <summary> /// Invoked when application execution is being suspended. Normally we /// wouldn't know if the app was being terminated or just suspended at this /// point. However, the app will never be suspeded if Game Bar has an /// active widget connection to it, so if you see this call it's safe to /// cleanup any widget related objects. Keep in mind if all widgets are closed /// and you have a foreground window for your app, this could still result in /// suspend or terminate. Regardless, it should always be safe to cleanup /// your widget related objects. /// </summary> /// <param name="sender">The source of the suspend request.</param> /// <param name="e">Details about the suspend request.</param> private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); widget1 = null; widget1Settings = null; deferral.Complete(); }
private async void OnApplicationSuspending(object sender, SuspendingEventArgs suspendingEventArgs) { SuspendingDeferral deferral = suspendingEventArgs.SuspendingOperation.GetDeferral(); m_DisplayRequest.RequestRelease(); await DisconnectBands(); deferral.Complete(); }
private void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); // In a regular app, this is where you would // Save application state and stop any background activity // But this should not be necessary in a test app deferral.Complete(); }
/// <summary> /// 在将要挂起应用程序执行时调用。 在不知道应用程序 /// 将被终止还是恢复的情况下保存应用程序状态, /// 并让内存内容保持不变。 /// </summary> /// <param name="sender">挂起的请求的源。</param> /// <param name="e">有关挂起的请求的详细信息。</param> private async void OnSuspending(object sender, SuspendingEventArgs e) { SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral(); // TODO: 保存应用程序状态并停止任何后台活动 await UmengAnalytics.EndTrackAsync(); deferral.Complete(); }