• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ApplicationModel.SuspendingEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Windows.ApplicationModel.SuspendingEventArgs的典型用法代码示例。如果您正苦于以下问题:C# SuspendingEventArgs类的具体用法?C# SuspendingEventArgs怎么用?C# SuspendingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SuspendingEventArgs类属于Windows.ApplicationModel命名空间,在下文中一共展示了SuspendingEventArgs类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnSuspending

        /// <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();
}
开发者ID:BeyondVincent,项目名称:WindowsStoreAppCode,代码行数:14,代码来源:App.xaml.cs


示例2: OnSuspending

 /// <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();
 }
开发者ID:BeyondVincent,项目名称:WindowsStoreAppCode,代码行数:14,代码来源:App.xaml.cs


示例3: OnSuspending

 /// <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();
 }
开发者ID:bayramucuncu,项目名称:CSharpAnalytics,代码行数:14,代码来源:App.xaml.cs


示例4: OnSuspending

 private async void OnSuspending(object sender, SuspendingEventArgs e)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     Debug.WriteLine("SuspensionManager.SaveAsync()");
     await SuspensionManager.SaveAsync();
     deferral.Complete();
 }
开发者ID:yamac,项目名称:windows-demos,代码行数:7,代码来源:App.xaml.cs


示例5: SaveDataToPersistedState

        /// <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();
            }
        }
开发者ID:C-C-D-I,项目名称:Windows-universal-samples,代码行数:32,代码来源:Scenario2.xaml.cs


示例6: Application_Suspending

 private async void Application_Suspending(object sender, SuspendingEventArgs e)
 {
     var deferral = e.SuspendingOperation.GetDeferral();
     // cleanupCamera
     await cleanupCameraAsync();
     deferral.Complete();
 }
开发者ID:agangal,项目名称:ARTest,代码行数:7,代码来源:VideoView.xaml.cs


示例7: OnSuspending

 protected override async void OnSuspending(object sender, SuspendingEventArgs e)
 {
     base.OnSuspending(sender, e);
     var deferal = e.SuspendingOperation.GetDeferral();
     await SuspensionManager.SaveAsync();
     deferal.Complete();
 }
开发者ID:ibebbs,项目名称:CaliburnDemoWinRT,代码行数:7,代码来源:App.xaml.cs


示例8: App_Suspending

 /// <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();
 }
开发者ID:jigartailor1984,项目名称:UWPAppSamples,代码行数:14,代码来源:BackgroundApp.cs


示例9: OnSuspending

 /// <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();
 }
开发者ID:elff1,项目名称:HelloWin8App,代码行数:14,代码来源:App.xaml.cs


示例10: OnSuspending

		/// <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();
		}
开发者ID:sdao,项目名称:TuneOut,代码行数:14,代码来源:App.xaml.cs


示例11: OnSuspending

        /// <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();
        }
开发者ID:RestfulMonad,项目名称:MetroMetro,代码行数:14,代码来源:App.xaml.cs


示例12: SaveDataToPersistedState

        /// <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();
            }
        }
开发者ID:mbin,项目名称:Win81App,代码行数:36,代码来源:ImagingProperties.xaml.cs


示例13: OnSuspending

 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();
 }
开发者ID:ktjones,项目名称:BVCS2012,代码行数:7,代码来源:App.xaml.cs


示例14: OnSuspendingAsync

 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();
 }
开发者ID:MuffPotter,项目名称:201505-MVA,代码行数:8,代码来源:App.xaml.cs


示例15: OnSuspendingAsync

        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();
        }
开发者ID:Ronacs,项目名称:WinDevCamp,代码行数:8,代码来源:App.xaml.cs


示例16: OnSusoending

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

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

            deferral.Complete();
        }
开发者ID:forehalo,项目名称:UWP-dev,代码行数:9,代码来源:App.xaml.cs


示例17: OnSuspending

        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();
        }
开发者ID:Zhionit,项目名称:ModernUI,代码行数:9,代码来源:App.xaml.cs


示例18: App_Suspending

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

            }
            catch (Exception) { }
        }
开发者ID:malikbenabda,项目名称:RestCoachWP,代码行数:9,代码来源:NotificationHistory.xaml.cs


示例19: CurrentOnSuspending

        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);
        }
开发者ID:h78hy78yhoi8j,项目名称:xenko,代码行数:10,代码来源:GamePlatform.Windows.Store.cs


示例20: OnSuspending

        /// <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();
        }
开发者ID:nincode,项目名称:derpsansa,代码行数:17,代码来源:App.xaml.cs



注:本文中的Windows.ApplicationModel.SuspendingEventArgs类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Activation.LaunchActivatedEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Network.GameServerPacket类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap