- Better-EN5 插件:基于官方示例,注册3个右键菜单项 - Manager 管理器:横版5标签布局,深色主题 WPF 应用 - 自定义 Fluent 安装器:无边框窗口,圆角,淡入淡出动画 - 删除旧代码,移除 SDK 自动安装器 - 三个项目全部编译通过(0 错误)
77 lines
2.2 KiB
C#
77 lines
2.2 KiB
C#
using System.Diagnostics;
|
|
using System.IO;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace BetterSeewoManager.Pages;
|
|
|
|
public partial class InstallPage : Page
|
|
{
|
|
private const string En5Path = @"C:\Program Files (x86)\Seewo\EasiNote5\EasiNote5_5.2.4.9855\Main";
|
|
|
|
public InstallPage()
|
|
{
|
|
InitializeComponent();
|
|
CheckEn5Status();
|
|
CheckPluginStatus();
|
|
}
|
|
|
|
private void CheckEn5Status()
|
|
{
|
|
if (Directory.Exists(En5Path))
|
|
{
|
|
var versionFile = Path.Combine(En5Path, "EasiNote5.exe");
|
|
if (File.Exists(versionFile))
|
|
{
|
|
var version = FileVersionInfo.GetVersionInfo(versionFile).FileVersion;
|
|
En5Status.Text = $"已安装 — v{version}";
|
|
En5Status.Foreground = FindResource("SuccessBrush") as System.Windows.Media.Brush;
|
|
return;
|
|
}
|
|
}
|
|
En5Status.Text = "未检测到";
|
|
En5Status.Foreground = FindResource("DangerBrush") as System.Windows.Media.Brush;
|
|
}
|
|
|
|
private void CheckPluginStatus()
|
|
{
|
|
var pluginPath = Path.Combine(En5Path, "Plugins", "Better-EN5");
|
|
if (Directory.Exists(pluginPath))
|
|
{
|
|
PluginStatus.Text = "已安装";
|
|
PluginStatus.Foreground = FindResource("SuccessBrush") as System.Windows.Media.Brush;
|
|
}
|
|
else
|
|
{
|
|
PluginStatus.Text = "未安装";
|
|
PluginStatus.Foreground = FindResource("TextSecondaryBrush") as System.Windows.Media.Brush;
|
|
}
|
|
}
|
|
|
|
private void BtnRefreshEn5_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
CheckEn5Status();
|
|
CheckPluginStatus();
|
|
}
|
|
|
|
private void BtnInstallPlugin_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
PluginStatus.Text = "安装功能开发中...";
|
|
}
|
|
|
|
private void BtnUninstallPlugin_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
PluginStatus.Text = "卸载功能开发中...";
|
|
}
|
|
|
|
private void BtnInstallManager_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
ManagerStatus.Text = "安装功能开发中...";
|
|
}
|
|
|
|
private void BtnUninstallManager_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
ManagerStatus.Text = "卸载功能开发中...";
|
|
}
|
|
}
|