Inheritance: ISuspendingEventArgs
        /// <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("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();
            }
        }
Exemple #2
0
 private void CoreApplication_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     if (OnSuspending != null)
     {
         this.OnSuspending(this, null);
     }
 }
Exemple #3
0
		/// <summary>
		/// Invoked when application execution is being suspended.  Application state is saved
		/// without knowing whether the application will be terminated or resumed with the content
		/// 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)
		{
			var deferral = e.SuspendingOperation.GetDeferral();
			await AudioController.Default.SerializeAsync();
			await TuneOut.Common.SuspensionManager.SaveAsync();
			deferral.Complete();
		}
Exemple #4
0
 /// <summary>
 /// 在将要挂起应用程序执行时调用。在不知道应用程序
 /// 将被终止还是恢复的情况下保存应用程序状态,
 /// 并让内存内容保持不变。
 /// </summary>
 /// <param name="sender">挂起的请求的源。</param>
 /// <param name="e">有关挂起的请求的详细信息。</param>
 private async void OnSuspending(object sender, SuspendingEventArgs e)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     //TODO: 保存应用程序状态并停止任何后台活动
     await HelloWorld.Common.SuspensionManager.SaveAsync();
     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 static async void OnSuspending(object sender, SuspendingEventArgs e)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     await SuspensionManager.SaveAsync();
     await AutoAnalytics.StopAsync();
     deferral.Complete();
 }
 /// <summary>
 /// 在将要挂起应用程序执行时调用。在不知道应用程序
 /// 将被终止还是恢复的情况下保存应用程序状态,
 /// 并让内存内容保持不变。
 /// </summary>
 /// <param name="sender">挂起的请求的源。</param>
 /// <param name="e">有关挂起的请求的详细信息。</param>
 private void OnSuspending(object sender, SuspendingEventArgs e)
 {
     SearchPane.GetForCurrentView().ShowOnKeyboardInput = false;
     var deferral = e.SuspendingOperation.GetDeferral();
     //TODO: 保存应用程序状态并停止任何后台活动
     deferral.Complete();
 }
Exemple #7
0
 private async void OnSuspending(object sender, SuspendingEventArgs e)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     Debug.WriteLine("SuspensionManager.SaveAsync()");
     await SuspensionManager.SaveAsync();
     deferral.Complete();
 }
        /// <summary>
        /// 在将要挂起应用程序执行时调用。在不知道应用程序
        /// 将被终止还是恢复的情况下保存应用程序状态,
        /// 并让内存内容保持不变。
        /// </summary>
        /// <param name="sender">挂起的请求的源。</param>
        /// <param name="e">有关挂起的请求的详细信息。</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
    ApplicationData.Current.LocalSettings.Values["suspendedDateTime"] = DateTime.Now.ToString();
    var deferral = e.SuspendingOperation.GetDeferral();
    //TODO: 保存应用程序状态并停止任何后台活动
    deferral.Complete();
}
        /// <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();
            }
        }
Exemple #10
0
 /// <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)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     //TODO: Save application state and stop any background activity
     await HelloWorld.Common.SuspensionManager.SaveAsync();
     deferral.Complete();
 }
Exemple #11
0
 async void App_Suspending(Object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     if (v)
     {
         await appWindow.CloseAsync();
     }
 }
Exemple #12
0
 private async void OnSuspending(object sender, SuspendingEventArgs e)
 {
   var deferral = e.SuspendingOperation.GetDeferral();
   KarliCards.Gui.Common.SuspensionManager.KnownTypes.Add(typeof(GameViewModel));
   await KarliCards.Gui.Common.SuspensionManager.SaveAsync();
   deferral.Complete();
 }
Exemple #13
0
 protected override async void OnSuspending(object sender, SuspendingEventArgs e)
 {
     base.OnSuspending(sender, e);
     var deferal = e.SuspendingOperation.GetDeferral();
     await SuspensionManager.SaveAsync();
     deferal.Complete();
 }
Exemple #14
0
 private async void Application_Suspending(object sender, SuspendingEventArgs e)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     // cleanupCamera
     await cleanupCameraAsync();
     deferral.Complete();
 }
Exemple #15
0
 private void OnApplicationSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     if (this.D2DSurface != null)
     {
         this.D2DSurface.CleanUpOnSuspend();
     }
 }
Exemple #16
0
        /// <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)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // TODO: Save application state and stop any background activity
            deferral.Complete();
        }
Exemple #17
0
        //アプリが一時停止しようとしたとき
        private async void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            //ここでアプリのデータや状態を保存するdeferral.Complete()が呼ばれるまではawaitしても待ってくれる
            var model = ServiceLocator.Current.GetInstance <MainViewModel>().MainModel;

            if (model.Settings.NotifyStudyRange != StudyRangeType.None)
            {
                var toast = new ToastContent()
                {
                    Visual = new ToastVisual()
                    {
                        TitleText = new ToastText()
                        {
                            Text = "WordShuffleで暗記しませんか?"
                        },
                        BodyTextLine1 = new ToastText()
                        {
                            Text = "継続して英単語を暗記しましょう!"
                        }
                    }
                };
                var notifir  = ToastNotificationManager.CreateToastNotifier();
                var schdules = notifir.GetScheduledToastNotifications();
                foreach (var notify in schdules)
                {
                    notifir.RemoveFromSchedule(notify);
                }

                TimeSpan nextTime = TimeSpan.Zero;
                switch (model.Settings.NotifyStudyRange)
                {
                case StudyRangeType.OneDay:
                    nextTime = TimeSpan.FromDays(1);
                    break;

                case StudyRangeType.ThreeDays:
                    nextTime = TimeSpan.FromDays(3);
                    break;

                case StudyRangeType.OneWeek:
                    nextTime = TimeSpan.FromDays(7);
                    break;

                case StudyRangeType.TwoWeeks:
                    nextTime = TimeSpan.FromDays(14);
                    break;

                case StudyRangeType.OneMonth:
                    nextTime = TimeSpan.FromDays(30);
                    break;
                }

                notifir.AddToSchedule(new ScheduledToastNotification(toast.GetXml(), new DateTimeOffset(DateTime.Now + nextTime)));
            }
            await SaveAllDataAsync();

            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 App_Suspending(object sender, SuspendingEventArgs e)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     // Optional: Save application state and stop any background activity
     ShowToast("Suspending");
     deferral.Complete();
 }
Exemple #19
0
 private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     var ignore = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() =>
     {
         await DisposeCaptureAsync();
     });
 }
Exemple #20
0
 /// <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)
 {
     SearchPane.GetForCurrentView().ShowOnKeyboardInput = false;
     var deferral = e.SuspendingOperation.GetDeferral();
     //TODO: Save application state and stop any background activity
     deferral.Complete();
 }
Exemple #21
0
 protected async override Task OnSuspendingAsync(object s, SuspendingEventArgs e)
 {
     // Dirty hack until I can figure out how to fix OnNavigatedFrom behaviour
     var deferral = e.SuspendingOperation.GetDeferral();
     // Give enough time for the file storage to work when app is suspending
     await Task.Delay(500);
     deferral.Complete();
 }
        private void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // await SuspensionManager.SaveAsync();

            deferral.Complete();
        }
        private void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // ToDo - Any suspension code here.

            deferral.Complete();
        }
Exemple #24
0
        protected async override Task OnSuspendingAsync(object s, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();
            // TODO Add any logic required on app suspension
            //await Task.Delay(500);

            deferral.Complete();
        }
Exemple #25
0
        /// <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)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // suspend here

            deferral.Complete();
        }
        private void App_Suspending(object sender, SuspendingEventArgs e)
        {
            try
            {
                Paramaters.savePreferencesData();

            }
            catch (Exception) { }
        }
Exemple #27
0
        private void OnSusoending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // TODO: 保存应用程序状态并停止任何后台活动
            UserData.SaveData();

            deferral.Complete();
        }
        private void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // Lorsque l'utilisateur passe à une autre application
            // Mettre le jeu en pause et sauvegarder les données

            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
        }
Exemple #30
0
        private async void OnSuspending(object sender, SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            // Guarda el estado de navegación del Frame y luego da a la Page la oportunidad de guardar su contenido
            await Evento_Suspending.Common.SuspensionManager.SaveAsync();

            deferral.Complete();
        }
        async void OnAppSuspending(object sender, SuspendingEventArgs args) {
            SuspendingDeferral deferral = args.SuspendingOperation.GetDeferral();

            // Log the suspension
            txtbox.Text += String.Format("Suspending at {0}\r\n", DateTime.Now.ToString());
            await FileIO.WriteTextAsync(logfile, txtbox.Text);
            //await PathIO.WriteTextAsync("ms-appdata:///local/logfile.txt", txtbox.Text);

            deferral.Complete();
        }
        private void CurrentOnSuspending(object sender, SuspendingEventArgs suspendingEventArgs)
        {
            using (var device3 = game.GraphicsDevice.NativeDevice.QueryInterface<SharpDX.DXGI.Device3>())
            {
                game.GraphicsDevice.ClearState();
                device3.Trim();    
            }

            OnSuspend(sender, null);
        }
 private void App_Suspending(object sender, SuspendingEventArgs e)
 {
     try
     {
         SharedInfo.saveSessions();
         Paramaters.savePreferencesData();
       //  Paramaters.saveTime(hours, minutes);
     }
     catch (Exception) { }
 }
Exemple #34
0
        /// <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)
        {
            var deferral = e.SuspendingOperation.GetDeferral();
            //TODO: Save application state and stop any background activity

            System.Diagnostics.Debug.WriteLine("OnSuspending");
            await HelloWorldRT.Common.SuspensionManager.SaveAsync();

            deferral.Complete();
        }
Exemple #35
0
        private async void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            appSetting.Save();
            SuspendingDeferral deferral      = e.SuspendingOperation.GetDeferral();
            StorageFolder      storageFolder = ApplicationData.Current.LocalFolder;
            StorageFile        storageFile   = await storageFolder.CreateFileAsync("XamlCrucher.xmal", CreationCollisionOption.OpenIfExists);

            await FileIO.WriteTextAsync(storageFile, edittext.Text);

            deferral.Complete();
        }
        private void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            ViewModel.SaveDataCommand.Execute(null);

            //Wenn Current_Suspending fertig ist, wird das Programm beendet und Thread-Code wird nicht mehr zu Ende geführt
            Task t = Task.Run(async() =>
            {
                //var handle = await ApplicationData.Current.LocalFolder.CreateFileAsync("Todos.json", CreationCollisionOption.ReplaceExisting);
            });

            Task.WaitAll(t);
        }
        private void App_Suspending(object sender, SuspendingEventArgs e)
        {
            try
            {
             //   SharedInfo.saveSessions();
                Paramaters.savePreferencesData();
                Paramaters.saveTime(hours, minutes, seconds);
                timeSuspended = DateTime.Now;
            }
            catch (Exception) { }

        }
        private async void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                await FinalizeMediaCaptureAsync();

                SystemMediaTransportControls.GetForCurrentView().PropertyChanged -= MainPage_PropertyChanged;

                deferral.Complete();
            }
        }
        private async void Application_Suspending(object sender, SuspendingEventArgs e)
        {
            // Handle global application events only if this page is active
            if (Frame.CurrentSourcePageType == typeof(MainPage))
            {
                var deferral = e.SuspendingOperation.GetDeferral();

                await CleanupCameraAsync();

                await CleanupUiAsync();

                deferral.Complete();
            }
        }
Exemple #40
0
 private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     if (this.currentState == ScenarioState.Streaming)
     {
         var deferral = e.SuspendingOperation.GetDeferral();
         try
         {
             this.ChangeScenarioState(ScenarioState.Idle);
         }
         finally
         {
             deferral.Complete();
         }
     }
 }
        private async void CrystalApplication_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            var deferral = e.SuspendingOperation.GetDeferral();

            try
            {
                await OnSuspendingAsync();
            }
            catch (Exception)
            {
            }
            finally
            {
                deferral.Complete();
            }
        }
        private void App_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            // SaveProfiles();

            if (this.BluetoothDeviceWatcher != null)
            {
                BluetoothDeviceWatcher.Added   -= BluetoothDeviceAdded;
                BluetoothDeviceWatcher.Updated -= BluetoothDeviceUpdated;

                BluetoothDeviceWatcher.Stop();

                this.BluetoothDeviceWatcher = null;
            }

            if (this.AllDevicesWatcher != null)
            {
                AllDevicesWatcher.Updated -= HIDDeviceUpdated;

                AllDevicesWatcher.Stop();

                this.AllDevicesWatcher = null;
            }
        }
Exemple #43
0
 private static void Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     ApplicationDeactivated();
 }
Exemple #44
0
 private void OnSuspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     // Hints to the driver that the app is entering an idle state and that its memory can be used temporarily for other apps.
     using (var dxgiDevice = d3dDevice.QueryInterface <SharpDX.DXGI.Device3>())
         dxgiDevice.Trim();
 }
Exemple #45
0
        private void CoreApplication_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
        {
            SuspendingDeferral deferral = e.SuspendingOperation.GetDeferral();

            deferral.Complete();
        }
Exemple #46
0
 private void suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     running  = false;
     deferral = e.SuspendingOperation.GetDeferral();
     Closing();
 }
Exemple #47
0
 private void CurrentApplication_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     SaveInfo();
 }
Exemple #48
0
 private static void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     ClearLiveTile();
     logger.Info("Cleared live tile on Suspending event.");
 }
 private void Current_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
     SetActualCurrentLastSelectedBookshelf();
 }
Exemple #50
0
 // 中断されるとき
 private void Application_Suspending(object sender, Windows.ApplicationModel.SuspendingEventArgs e)
 {
 }