zoukankan      html  css  js  c++  java
  • Win8开发笔记2 OnLaunched介绍

    Class App 中 OnLaunched(LaunchActiatedEventArgs args) 是在应用程序正常启动时调用,一般包括两种情况:初次启动、挂起后继续,其中参数args指的是上一次的软件上一次运行的状态,可以通过下面的代码来测试:

     

                /*------------------------------------------------------------------------------------*/
                // 判断前一个状态   ***注意是前一个状态
                string State = string.Empty;
                switch (args.PreviousExecutionState)
                {
                    case ApplicationExecutionState.ClosedByUser:
                        State = string.Format("yao---{0} - 应用程序被用户关闭。", DateTime.Now.ToString("HH:mm:ss"));
                        break;
                    case ApplicationExecutionState.NotRunning:
                        State = string.Format("yao---{0} - 应用程序未运行。", DateTime.Now.ToString("HH:mm:ss"));
                        break;
                    case ApplicationExecutionState.Running:
                        State = string.Format("yao---{0} - 应用程序正在运行。", DateTime.Now.ToString("HH:mm:ss"));
                        break;
                    case ApplicationExecutionState.Suspended:
                        State = string.Format("yao---{0} - 应用程序被挂起。", DateTime.Now.ToString("HH:mm:ss"));
                        break;
                    case ApplicationExecutionState.Terminated:
                        State = string.Format("yao---{0} - 应用程序终止运行。", DateTime.Now.ToString("HH:mm:ss"));
                        break;
                    default:
                        State = "";
                        break;
                }
                System.Diagnostics.Debug.WriteLine(State);
                /*------------------------------------------------------------------------------------*/  

     

    另外推荐一个系统学习Win8开发贴:

    http://bbs.windevcenter.com/forum.php?mod=viewthread&tid=2869&reltid=2868&pre_thread_id=3721&pre_pos=4&ext=

     

  • 相关阅读:
    做支付遇到的HttpClient大坑
    一个隐藏在支付系统很长时间的雷
    记一次自动恢复的支付故障
    从GopherChina 2019看当前的go语言
    记一次上线就跪的故障排查案例
    springboot 源码笔记
    计算多边形面积
    springboots Helloworld
    springboots 配置文件
    springboots 环境搭建
  • 原文地址:https://www.cnblogs.com/Roarsun/p/2827277.html
Copyright © 2011-2022 走看看