259ce3dd11
添加 IAppRestartService 接口及其实现 AppRestartService,用于插件系统调用应用重启功能 将原 StartupPage 中的重启逻辑提取到 AppRestartHelper 工具类中 在 App.xaml.cs 中注册 AppRestartService 供插件使用
41 lines
964 B
C#
41 lines
964 B
C#
using Ink_Canvas.Helpers;
|
|
using Ink_Canvas.Plugins;
|
|
|
|
namespace Ink_Canvas.Plugins
|
|
{
|
|
public class AppRestartService : IAppRestartService
|
|
{
|
|
public bool IsRunningAsAdmin => AppRestartHelper.IsRunningAsAdmin();
|
|
|
|
public void RestartApp(bool asAdmin)
|
|
{
|
|
AppRestartHelper.RestartApp(asAdmin);
|
|
}
|
|
|
|
public void RestartWithCurrentPrivileges()
|
|
{
|
|
AppRestartHelper.RestartWithCurrentPrivileges();
|
|
}
|
|
|
|
public void RestartAsAdmin()
|
|
{
|
|
AppRestartHelper.RestartAsAdmin();
|
|
}
|
|
|
|
public void RestartAsNormal()
|
|
{
|
|
AppRestartHelper.RestartAsNormal();
|
|
}
|
|
|
|
public void SwitchToUIATopMostAndRestart()
|
|
{
|
|
AppRestartHelper.SwitchToUIATopMostAndRestart();
|
|
}
|
|
|
|
public void SwitchToNormalTopMostAndRestart()
|
|
{
|
|
AppRestartHelper.SwitchToNormalTopMostAndRestart();
|
|
}
|
|
}
|
|
}
|