コード例 #1
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();

            CoreWindowLogic.SaveSettings();
            await Task.Delay(500);

            deferral.Complete();
        }
コード例 #2
0
        private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            BLogger.Logger.Info("App has entered background...");
            CoreWindowLogic.SaveSettings();
            CoreWindowLogic.UpdateSmtc();
            deferral.Complete();
        }
コード例 #3
0
ファイル: App.xaml.cs プロジェクト: JohnHwangx/BreadPlayer
        /// <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();

            SessionWatch.Stop();
            BLogger.Logger.Info("App suspended and session terminated. Session length: " + SessionWatch.Elapsed.TotalMinutes);
            CoreWindowLogic.SaveSettings();
            await Task.Delay(500);

            deferral.Complete();
        }
コード例 #4
0
        private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            CoreWindowLogic.SaveSettings();
            CoreWindowLogic.UpdateSmtc(true);
            CoreWindowLogic.EnableDisableSmtc();
            await Task.Delay(200);

            CoreWindowLogic.isBackground = true;
            deferral.Complete();
        }
コード例 #5
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();
            await LockscreenHelper.ResetLockscreenImage();

            _sessionWatch?.Stop();
            BLogger.I("App suspended and session terminated. Session length: " + _sessionWatch.Elapsed.TotalMinutes);
            CoreWindowLogic.SaveSettings();
            //CoreWindowLogic.DisposeObjects();
            await Task.Delay(500);

            deferral.Complete();
        }
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: vsarunov/BreadPlayer
        private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            CoreWindowLogic.SaveSettings();
            CoreWindowLogic.UpdateSmtc(true);
            if (!firsttime)
            {
                CoreWindowLogic.EnableDisableSmtc();
            }
            else
            {
                firsttime = false;
            }
            await Task.Delay(200);

            CoreWindowLogic.isBackground = true;
            BLogger.Logger.Info("App has entered background...");
            deferral.Complete();
        }