Table of Contents

Class App

Namespace
Ink_Canvas
Assembly
InkCanvasForClass.dll

Interaction logic for App.xaml

public class App : Application, IQueryAmbient, IComponentConnector, IStyleConnector
Inheritance
App
Implements
Inherited Members

Constructors

App()

public App()

Fields

CrashAction

public static App.CrashActionType CrashAction

Field Value

App.CrashActionType

IsAppExitByUser

public static bool IsAppExitByUser

Field Value

bool

IsOobeShowing

public static bool IsOobeShowing

Field Value

bool

IsUIAccessTopMostEnabled

public static bool IsUIAccessTopMostEnabled

Field Value

bool

IsUpdateInstalling

public static bool IsUpdateInstalling

Field Value

bool

RootPath

public static string RootPath

Field Value

string

StartArgs

public static string[] StartArgs

Field Value

string[]

StartWithBoardMode

public static bool StartWithBoardMode

Field Value

bool

StartWithShowMode

public static bool StartWithShowMode

Field Value

bool

watchdogProcess

public static Process watchdogProcess

Field Value

Process

Methods

CloseSplashScreen()

public static void CloseSplashScreen()

InitializeComponent()

InitializeComponent

public void InitializeComponent()

Main()

Application Entry Point.

[STAThread]
public static void Main()

RunWatchdogIfNeeded()

作为守护进程监视指定的主进程,并在主进程异常退出时根据配置执行重启或退出操作。

public static void RunWatchdogIfNeeded()

Remarks

该方法期望命令行参数格式为:"--watchdog <pid> <exitSignalFile>"(args[1..3])。

  • 每 2 秒检查一次指定的主进程是否仍在运行;同时检测退出信号文件,若存在则删除该文件并以代码 0 退出守护进程。
  • 当主进程退出时,会同步崩溃处理设置(SyncCrashActionFromSettings)。若启用了 UIA 顶层访问(IsUIAccessTopMostEnabled),守护进程直接退出。
  • 若崩溃动作为 SilentRestart,则增加启动计数并:当连续重启计数达到 5 次及以上时弹出错误对话框、重置计数并以代码 1 退出;否则启动新的主进程实例。
    方法对内部异常静默处理,并在完成后确保进程退出。

SetSplashMessage(string)

public static void SetSplashMessage(string message)

Parameters

message string

SetSplashProgress(int)

public static void SetSplashProgress(int progress)

Parameters

progress int

ShowSplashScreen()

public static void ShowSplashScreen()

StartWatchdogIfNeeded()

public static void StartWatchdogIfNeeded()

SyncCrashActionFromSettings()

public static void SyncCrashActionFromSettings()