当前位置: 首页>>代码示例>>C#>>正文


C# ApplicationModel.SuspendingEventArgs类代码示例

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


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


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