feat(插件): 添加应用重启服务接口及实现
添加 IAppRestartService 接口及其实现 AppRestartService,用于插件系统调用应用重启功能 将原 StartupPage 中的重启逻辑提取到 AppRestartHelper 工具类中 在 App.xaml.cs 中注册 AppRestartService 供插件使用
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user