diff --git a/Better-EN5/Better-EN5.csproj b/Better-EN5/Better-EN5.csproj
index 7bdc1b9..8bd159f 100644
--- a/Better-EN5/Better-EN5.csproj
+++ b/Better-EN5/Better-EN5.csproj
@@ -9,11 +9,11 @@
Better-EN5
1.1.0
1.1.0
- 云汀
- 云汀
- 云汀
+ 雾启工作室
+ 雾启工作室
+ 雾启工作室
Better-Seewo 增强插件
- 希沃白板功能增强插件 - 墨迹管理、文件转换增强、触摸检测修复、大屏模式支持、专业版激活
+ 雾生万象,启以为光 — 希沃白板功能增强插件
all
diff --git a/Better-EN5/Program.cs b/Better-EN5/Program.cs
index a4c464a..68216be 100644
--- a/Better-EN5/Program.cs
+++ b/Better-EN5/Program.cs
@@ -43,29 +43,22 @@ namespace BetterEN5
{
var manager = Container.Current.Get();
- manager.AppendWithLang(new ApplicationMenuSettings(),
- new UIItemAttribute(new[] { "ApplicationMenu" }), new[]
- {
- new UIItemLangInfo(new CultureInfo("zh-CHS"), "Better-Seewo"),
- new UIItemLangInfo(new CultureInfo("en"), "Better-Seewo"),
- });
-
- manager.AppendWithLang(new ApplicationMenuExportInk(),
- new UIItemAttribute(new[] { "ApplicationMenu" }), new[]
+ manager.AppendWithLang(new BoardMenuExportInk(),
+ new UIItemAttribute(UIItemPurposes.BoardEditMenu), new[]
{
new UIItemLangInfo(new CultureInfo("zh-CHS"), "导出墨迹"),
new UIItemLangInfo(new CultureInfo("en"), "Export Ink"),
});
- manager.AppendWithLang(new HeadToolBarInkImport(),
- new UIItemAttribute(new[] { "HeadToolBar" }), new[]
+ manager.AppendWithLang(new BoardMenuSettings(),
+ new UIItemAttribute(UIItemPurposes.BoardEditMenu), new[]
{
- new UIItemLangInfo(new CultureInfo("zh-CHS"), "导入墨迹"),
- new UIItemLangInfo(new CultureInfo("en"), "Import Ink"),
+ new UIItemLangInfo(new CultureInfo("zh-CHS"), "Better-Seewo"),
+ new UIItemLangInfo(new CultureInfo("en"), "Better-Seewo"),
});
- manager.AppendWithLang(new ExtendedTitleBarSettings(),
- new UIItemAttribute(new[] { "ExtendedTitleBar" }), new[]
+ manager.AppendWithLang(new HeadToolBarSettings(),
+ new UIItemAttribute(UIItemPurposes.HeadToolBar), new[]
{
new UIItemLangInfo(new CultureInfo("zh-CHS"), "Better-Seewo"),
new UIItemLangInfo(new CultureInfo("en"), "Better-Seewo"),
diff --git a/Better-EN5/UI/BetterEN5Module.xaml b/Better-EN5/UI/BetterEN5Module.xaml
deleted file mode 100644
index 4142a7a..0000000
--- a/Better-EN5/UI/BetterEN5Module.xaml
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
- #60B0FF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Better-EN5/UI/BetterEN5Module.xaml.cs b/Better-EN5/UI/BetterEN5Module.xaml.cs
deleted file mode 100644
index d9b0574..0000000
--- a/Better-EN5/UI/BetterEN5Module.xaml.cs
+++ /dev/null
@@ -1,204 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using Microsoft.Win32;
-using BetterEN5.Services;
-
-namespace BetterEN5.UI
-{
- public partial class BetterEN5Module : UserControl
- {
- private readonly InkService _inkService = new();
- private readonly ConversionService _conversionService = new();
- private readonly ActivationService _activationService = new();
-
- public BetterEN5Module()
- {
- InitializeComponent();
- Loaded += OnLoaded;
- }
-
- private async void OnLoaded(object sender, RoutedEventArgs e)
- {
- await RefreshStatusAsync();
- }
-
- public async Task RefreshStatusAsync()
- {
- try
- {
- var touchOk = await Task.Run(() => TouchFixService.IsTouchWorkingCorrectly());
- TouchStatus.Text = touchOk ? "✅ IWB 模式已启用" : "⚠️ 未启用 IWB 模式";
-
- var activationInfo = await Task.Run(() => _activationService.GetCurrentStatus());
- ActivationStatusText.Text = activationInfo.IsProfessional
- ? $"✅ 专业版已激活 | {activationInfo.LastActivationDate}"
- : "🔓 社区版 · 点击激活";
- }
- catch { }
- }
-
- private async void ExportInk_Click(object sender, RoutedEventArgs e)
- {
- var dialog = new SaveFileDialog
- {
- Title = "导出墨迹",
- Filter = "墨迹文件|*.ink.json|JSON 文件|*.json|所有文件|*.*",
- DefaultExt = ".ink.json"
- };
- if (dialog.ShowDialog() == true)
- {
- try
- {
- await _inkService.ExportInkAsync(dialog.FileName);
- InkStatus.Text = $"✅ 已导出: {Path.GetFileName(dialog.FileName)}";
- }
- catch (Exception ex)
- {
- InkStatus.Text = $"❌ 导出失败: {ex.Message}";
- }
- }
- }
-
- private async void ImportInk_Click(object sender, RoutedEventArgs e)
- {
- var dialog = new OpenFileDialog
- {
- Title = "导入墨迹",
- Filter = "墨迹文件|*.ink.json|JSON 文件|*.json|所有文件|*.*"
- };
- if (dialog.ShowDialog() == true)
- {
- try
- {
- await _inkService.ImportInkAsync(dialog.FileName);
- InkStatus.Text = "✅ 墨迹已导入";
- }
- catch (Exception ex)
- {
- InkStatus.Text = $"❌ 导入失败: {ex.Message}";
- }
- }
- }
-
- private async void ConvertPptx_Click(object sender, RoutedEventArgs e)
- {
- var dialog = new OpenFileDialog
- {
- Title = "选择 PowerPoint 文件",
- Filter = "PowerPoint 文件|*.pptx|所有文件|*.*"
- };
- if (dialog.ShowDialog() == true)
- {
- try
- {
- var result = await _conversionService.ConvertPptxToEnbxAsync(dialog.FileName);
- ConversionStatus.Text = $"✅ 转换完成: {Path.GetFileName(result)}";
- }
- catch (Exception ex)
- {
- ConversionStatus.Text = $"❌ 转换失败: {ex.Message}";
- }
- }
- }
-
- private async void ConvertEnbx_Click(object sender, RoutedEventArgs e)
- {
- var dialog = new OpenFileDialog
- {
- Title = "选择希沃白板课件",
- Filter = "希沃课件|*.enbx|所有文件|*.*"
- };
- if (dialog.ShowDialog() == true)
- {
- try
- {
- var result = await _conversionService.ConvertEnbxToPptxAsync(dialog.FileName);
- ConversionStatus.Text = $"✅ 导出完成: {Path.GetFileName(result)}";
- }
- catch (Exception ex)
- {
- ConversionStatus.Text = $"❌ 导出失败: {ex.Message}";
- }
- }
- }
-
- private async void CheckTouch_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- var touchOk = await Task.Run(() => TouchFixService.IsTouchWorkingCorrectly());
- TouchStatus.Text = touchOk ? "✅ 触摸状态正常" : "⚠️ 触摸可能需要修复";
- }
- catch (Exception ex)
- {
- TouchStatus.Text = $"❌ 检测失败: {ex.Message}";
- }
- }
-
- private async void ApplyTouchFix_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- await TouchFixService.ApplyFixAsync();
- TouchStatus.Text = "✅ 触摸修复已应用,重启后生效";
- }
- catch (Exception ex)
- {
- TouchStatus.Text = $"❌ 修复失败: {ex.Message}";
- }
- }
-
- private async void EnableBoardSupport_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- var ok = await _activationService.ApplyBoardSupportPatchAsync();
- BoardStatus.Text = ok ? "✅ 大屏模式已配置" : "❌ 配置失败";
- }
- catch (Exception ex)
- {
- BoardStatus.Text = $"❌ 错误: {ex.Message}";
- }
- }
-
- private async void EnableIWB_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- var ok = await _activationService.EnableIWBForNonTouchAsync();
- BoardStatus.Text = ok ? "✅ IWB 模式已启用" : "❌ 启用失败";
- }
- catch (Exception ex)
- {
- BoardStatus.Text = $"❌ 错误: {ex.Message}";
- }
- }
-
- private async void ActivatePro_Click(object sender, RoutedEventArgs e)
- {
- var dialog = new ActivateDialog();
- var ownerWindow = Window.GetWindow(this);
- if (ownerWindow != null) dialog.Owner = ownerWindow;
- if (dialog.ShowDialog() == true)
- {
- var ok = await _activationService.ActivateProfessionalAsync(dialog.LicenseKey);
- ActivationStatusText.Text = ok ? "✅ 激活成功!专业版已启用" : "❌ 激活码无效";
- }
- }
-
- private async void LaunchInstaller_Click(object sender, RoutedEventArgs e)
- {
- var ok = await _activationService.LaunchBen5InstallerAsync();
- if (!ok)
- {
- MessageBox.Show("未找到注册补丁安装程序。\n请将 BEN5_Installer.exe 放置于插件目录。",
- "提示", MessageBoxButton.OK, MessageBoxImage.Information);
- }
- }
- }
-}
diff --git a/Better-EN5/UI/BetterSeewoMainWindow.xaml b/Better-EN5/UI/BetterSeewoMainWindow.xaml
index ba6158a..f1d6576 100644
--- a/Better-EN5/UI/BetterSeewoMainWindow.xaml
+++ b/Better-EN5/UI/BetterSeewoMainWindow.xaml
@@ -1,107 +1,178 @@
- #0D0D1A
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ #0F0F1A
+ #1A1A2E
+ #60B0FF
+ #D0D0E0
+ #707090
+
+
-
+
-
+
-
+
-
+
+
-
-
-
+
+
-
+
-
+
+ Foreground="{StaticResource SubFg}" FontSize="12"
+ Cursor="Hand" Click="Close_Click"/>
-
+
+
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
diff --git a/Better-EN5/UI/BetterSeewoMainWindow.xaml.cs b/Better-EN5/UI/BetterSeewoMainWindow.xaml.cs
index a5ed854..ae28e9a 100644
--- a/Better-EN5/UI/BetterSeewoMainWindow.xaml.cs
+++ b/Better-EN5/UI/BetterSeewoMainWindow.xaml.cs
@@ -1,12 +1,21 @@
using System;
+using System.IO;
using System.Linq;
+using System.Threading.Tasks;
using System.Windows;
+using System.Windows.Controls;
using System.Windows.Media.Animation;
+using Microsoft.Win32;
+using BetterEN5.Services;
namespace BetterEN5.UI
{
public partial class BetterSeewoMainWindow : Window
{
+ private readonly InkService _inkService = new();
+ private readonly ConversionService _conversionService = new();
+ private readonly ActivationService _activationService = new();
+
public BetterSeewoMainWindow()
{
InitializeComponent();
@@ -15,47 +24,185 @@ namespace BetterEN5.UI
private void OnLoaded(object sender, RoutedEventArgs e)
{
- var storyboard = (Storyboard)Resources["ScaleInStoryboard"];
- BeginStoryboard(storyboard);
+ var sb = (Storyboard)TryFindResource("ScaleInStoryboard");
+ if (sb != null) BeginStoryboard(sb);
+ _ = RefreshStatusAsync();
}
- private void Minimize_Click(object sender, RoutedEventArgs e)
+ private void NavChanged(object sender, RoutedEventArgs e)
{
- WindowState = WindowState.Minimized;
+ if (sender == NavInk) ShowPanel(PanelInk);
+ else if (sender == NavConvert) ShowPanel(PanelConvert);
+ else if (sender == NavTouch) ShowPanel(PanelTouch);
+ else if (sender == NavBoard) ShowPanel(PanelBoard);
+ else if (sender == NavActivate) ShowPanel(PanelActivate);
}
- private void Maximize_Click(object sender, RoutedEventArgs e)
+ private void ShowPanel(StackPanel panel)
{
- WindowState = WindowState == WindowState.Maximized
- ? WindowState.Normal
- : WindowState.Maximized;
+ foreach (var p in new[] { PanelInk, PanelConvert, PanelTouch, PanelBoard, PanelActivate })
+ p.Visibility = p == panel ? Visibility.Visible : Visibility.Collapsed;
}
- private void Close_Click(object sender, RoutedEventArgs e)
+ private async Task RefreshStatusAsync()
{
- Close();
+ var touchOk = await Task.Run(() => TouchFixService.IsTouchWorkingCorrectly());
+ TouchStatus.Text = touchOk ? "✅ IWB 模式已启用" : "⚠️ 未启用 IWB 模式";
+ var info = await Task.Run(() => _activationService.GetCurrentStatus());
+ ActivationStatusText.Text = info.IsProfessional
+ ? $"✅ 专业版 · {info.LastActivationDate}"
+ : "🔓 社区版";
}
- public void RefreshModule()
+ private void Minimize_Click(object s, RoutedEventArgs e) => WindowState = WindowState.Minimized;
+ private void Maximize_Click(object s, RoutedEventArgs e) => WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
+ private void Close_Click(object s, RoutedEventArgs e) => Close();
+
+ private async void ExportInk_Click(object s, RoutedEventArgs e)
{
- En5Module?.RefreshStatusAsync();
+ var dialog = new SaveFileDialog { Title = "导出墨迹", Filter = "墨迹文件|*.ink.json|JSON|*.json", DefaultExt = ".ink.json" };
+ if (dialog.ShowDialog() == true)
+ {
+ await ProgressDialog.Show(this, "导出墨迹", async p =>
+ {
+ p.UpdateStatus("正在导出墨迹...", "读取课件笔迹数据");
+ await _inkService.ExportInkAsync(dialog.FileName);
+ p.UpdateStatus("导出完成", $"已保存至 {Path.GetFileName(dialog.FileName)}");
+ });
+ InkStatus.Text = $"已导出: {Path.GetFileName(dialog.FileName)}";
+ }
+ }
+
+ private async void ImportInk_Click(object s, RoutedEventArgs e)
+ {
+ var dialog = new OpenFileDialog { Title = "导入墨迹", Filter = "墨迹文件|*.ink.json|JSON|*.json" };
+ if (dialog.ShowDialog() == true)
+ {
+ await ProgressDialog.Show(this, "导入墨迹", async p =>
+ {
+ p.UpdateStatus("正在导入墨迹...", "写入课件笔迹");
+ await _inkService.ImportInkAsync(dialog.FileName);
+ });
+ InkStatus.Text = "墨迹已导入";
+ }
+ }
+
+ private async void ConvertPptx_Click(object s, RoutedEventArgs e)
+ {
+ var dialog = new OpenFileDialog { Title = "选择 PPT", Filter = "PowerPoint|*.pptx" };
+ if (dialog.ShowDialog() == true)
+ {
+ await ProgressDialog.Show(this, "转换文件", async p =>
+ {
+ p.UpdateStatus("正在转换 PPT → ENBX...", "调用转换器");
+ var result = await _conversionService.ConvertPptxToEnbxAsync(dialog.FileName);
+ p.UpdateStatus("转换完成", Path.GetFileName(result));
+ });
+ }
+ }
+
+ private async void ConvertEnbx_Click(object s, RoutedEventArgs e)
+ {
+ var dialog = new OpenFileDialog { Title = "选择 ENBX", Filter = "希沃课件|*.enbx" };
+ if (dialog.ShowDialog() == true)
+ {
+ await ProgressDialog.Show(this, "转换文件", async p =>
+ {
+ p.UpdateStatus("正在转换 ENBX → PPT...", "调用转换器");
+ var result = await _conversionService.ConvertEnbxToPptxAsync(dialog.FileName);
+ p.UpdateStatus("导出完成", Path.GetFileName(result));
+ });
+ }
+ }
+
+ private async void CheckTouch_Click(object s, RoutedEventArgs e)
+ {
+ var ok = await Task.Run(() => TouchFixService.IsTouchWorkingCorrectly());
+ TouchStatus.Text = ok ? "✅ IWB 模式已启用" : "⚠️ 未启用 IWB 模式";
+ }
+
+ private async void ApplyTouchFix_Click(object s, RoutedEventArgs e)
+ {
+ await ProgressDialog.Show(this, "触摸修复", async p =>
+ {
+ p.UpdateStatus("正在写入注册表配置...", "ForceIWB");
+ await Task.Run(() => TouchFixService.ApplyFixAsync());
+ p.UpdateStatus("正在配置 IWB 模式...", "IWBConfig.json");
+ await Task.Delay(300);
+ p.UpdateStatus("完成", "请重启希沃白板生效");
+ });
+ TouchStatus.Text = "修复已应用,请重启";
+ }
+
+ private async void EnableBoardSupport_Click(object s, RoutedEventArgs e)
+ {
+ await ProgressDialog.Show(this, "大屏支持", async p =>
+ {
+ p.UpdateStatus("正在配置大屏模式...", "修补 Configs.fkv");
+ await _activationService.ApplyBoardSupportPatchAsync();
+ p.UpdateStatus("正在写入注册表...", "大屏相关键值");
+ await Task.Delay(200);
+ p.UpdateStatus("完成", "大屏模式已配置");
+ });
+ BoardStatus.Text = "大屏模式已配置";
+ }
+
+ private async void EnableIWB_Click(object s, RoutedEventArgs e)
+ {
+ await ProgressDialog.Show(this, "IWB 模式", async p =>
+ {
+ p.UpdateStatus("正在启用 IWB 模式...", "注册表 + 配置文件");
+ await _activationService.EnableIWBForNonTouchAsync();
+ p.UpdateStatus("完成", "IWB 模式已启用,重启生效");
+ });
+ BoardStatus.Text = "IWB 已启用";
+ }
+
+ private async void ActivatePro_Click(object s, RoutedEventArgs e)
+ {
+ var dlg = new ActivateDialog();
+ dlg.Owner = this;
+ if (dlg.ShowDialog() == true)
+ {
+ await ProgressDialog.Show(this, "激活", async p =>
+ {
+ p.UpdateStatus("正在验证激活码...", "");
+ var ok = await _activationService.ActivateProfessionalAsync(dlg.LicenseKey);
+ if (ok)
+ {
+ p.UpdateStatus("激活成功", "专业版已启用");
+ ActivationStatusText.Text = "✅ 专业版已激活";
+ }
+ else
+ {
+ p.UpdateStatus("激活失败", "激活码无效");
+ }
+ });
+ }
+ }
+
+ private async void LaunchInstaller_Click(object s, RoutedEventArgs e)
+ {
+ var ok = await _activationService.LaunchBen5InstallerAsync();
+ if (!ok)
+ MessageBox.Show(this, "未找到注册补丁安装程序", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
+ }
+
+ private async void CheckActivation_Click(object s, RoutedEventArgs e)
+ {
+ var info = await Task.Run(() => _activationService.GetCurrentStatus());
+ ActivationStatusText.Text = info.IsProfessional
+ ? $"✅ 专业版 · {info.LastActivationDate}"
+ : "🔓 社区版";
}
public static void ShowWindow()
{
Application.Current.Dispatcher.Invoke(() =>
{
- var existing = Application.Current.Windows.OfType().FirstOrDefault();
- if (existing != null)
- {
- if (existing.WindowState == WindowState.Minimized)
- existing.WindowState = WindowState.Normal;
- existing.Activate();
- return;
- }
-
- var window = new BetterSeewoMainWindow();
- window.Show();
+ var w = Application.Current.Windows.OfType().FirstOrDefault();
+ if (w != null) { w.Activate(); return; }
+ new BetterSeewoMainWindow().Show();
});
}
}
diff --git a/Better-EN5/UI/ApplicationMenuExportInk.cs b/Better-EN5/UI/BoardMenuExportInk.cs
similarity index 89%
rename from Better-EN5/UI/ApplicationMenuExportInk.cs
rename to Better-EN5/UI/BoardMenuExportInk.cs
index 893967f..0a126f5 100644
--- a/Better-EN5/UI/ApplicationMenuExportInk.cs
+++ b/Better-EN5/UI/BoardMenuExportInk.cs
@@ -5,9 +5,9 @@ using BetterEN5.Services;
namespace BetterEN5.UI
{
- public class ApplicationMenuExportInk : HeadToolBarItem
+ public class BoardMenuExportInk : BoardEditMenuItem
{
- public ApplicationMenuExportInk()
+ public BoardMenuExportInk()
{
SortHint = 998;
Command = new DelegateCommand(() =>
diff --git a/Better-EN5/UI/ExtendedTitleBarSettings.cs b/Better-EN5/UI/BoardMenuSettings.cs
similarity index 69%
rename from Better-EN5/UI/ExtendedTitleBarSettings.cs
rename to Better-EN5/UI/BoardMenuSettings.cs
index 235b6f7..be1c713 100644
--- a/Better-EN5/UI/ExtendedTitleBarSettings.cs
+++ b/Better-EN5/UI/BoardMenuSettings.cs
@@ -1,11 +1,13 @@
+using System.Linq;
+using System.Windows;
using Cvte.EasiNote;
using Cvte.Windows.Input;
namespace BetterEN5.UI
{
- public class ExtendedTitleBarSettings : HeadToolBarItem
+ public class BoardMenuSettings : BoardEditMenuItem
{
- public ExtendedTitleBarSettings()
+ public BoardMenuSettings()
{
SortHint = 999;
Command = new DelegateCommand(() =>
diff --git a/Better-EN5/UI/ComingSoonModule.xaml b/Better-EN5/UI/ComingSoonModule.xaml
deleted file mode 100644
index a491584..0000000
--- a/Better-EN5/UI/ComingSoonModule.xaml
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Better-EN5/UI/ComingSoonModule.xaml.cs b/Better-EN5/UI/ComingSoonModule.xaml.cs
deleted file mode 100644
index 0ce769b..0000000
--- a/Better-EN5/UI/ComingSoonModule.xaml.cs
+++ /dev/null
@@ -1,12 +0,0 @@
-using System.Windows.Controls;
-
-namespace BetterEN5.UI
-{
- public partial class ComingSoonModule : UserControl
- {
- public ComingSoonModule()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/Better-EN5/UI/HeadToolBarInkImport.cs b/Better-EN5/UI/HeadToolBarInkImport.cs
deleted file mode 100644
index 0a794ed..0000000
--- a/Better-EN5/UI/HeadToolBarInkImport.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using Microsoft.Win32;
-using Cvte.EasiNote;
-using Cvte.Windows.Input;
-using BetterEN5.Services;
-
-namespace BetterEN5.UI
-{
- public class HeadToolBarInkImport : HeadToolBarItem
- {
- public HeadToolBarInkImport()
- {
- SortHint = 900;
- Command = new DelegateCommand(() =>
- {
- var dialog = new OpenFileDialog
- {
- Title = "导入墨迹",
- Filter = "墨迹文件 (*.ink.json)|*.ink.json|JSON 文件 (*.json)|*.json"
- };
- if (dialog.ShowDialog() == true)
- {
- var inkService = new InkService();
- _ = inkService.ImportInkAsync(dialog.FileName);
- }
- });
- Predicate = _ => true;
- }
- }
-}
diff --git a/Better-EN5/UI/ApplicationMenuSettings.cs b/Better-EN5/UI/HeadToolBarSettings.cs
similarity index 75%
rename from Better-EN5/UI/ApplicationMenuSettings.cs
rename to Better-EN5/UI/HeadToolBarSettings.cs
index e7577e7..4e6f3cf 100644
--- a/Better-EN5/UI/ApplicationMenuSettings.cs
+++ b/Better-EN5/UI/HeadToolBarSettings.cs
@@ -3,9 +3,9 @@ using Cvte.Windows.Input;
namespace BetterEN5.UI
{
- public class ApplicationMenuSettings : HeadToolBarItem
+ public class HeadToolBarSettings : HeadToolBarItem
{
- public ApplicationMenuSettings()
+ public HeadToolBarSettings()
{
SortHint = 999;
Command = new DelegateCommand(() =>
diff --git a/Better-EN5/UI/ProgressDialog.xaml b/Better-EN5/UI/ProgressDialog.xaml
new file mode 100644
index 0000000..591bed2
--- /dev/null
+++ b/Better-EN5/UI/ProgressDialog.xaml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Better-EN5/UI/ProgressDialog.xaml.cs b/Better-EN5/UI/ProgressDialog.xaml.cs
new file mode 100644
index 0000000..0013edb
--- /dev/null
+++ b/Better-EN5/UI/ProgressDialog.xaml.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace BetterEN5.UI
+{
+ public partial class ProgressDialog : Window
+ {
+ public ProgressDialog()
+ {
+ InitializeComponent();
+ Loaded += (s, e) =>
+ {
+ var desktop = System.Windows.SystemParameters.WorkArea;
+ Left = (desktop.Width - Width) / 2;
+ Top = (desktop.Height - Height) / 2;
+ };
+ }
+
+ public void UpdateStatus(string text, string detail = "")
+ {
+ Dispatcher.Invoke(() =>
+ {
+ StatusText.Text = text;
+ if (!string.IsNullOrEmpty(detail))
+ DetailText.Text = detail;
+ });
+ }
+
+ public async Task RunWithProgress(Func action)
+ {
+ try
+ {
+ await action(this);
+ UpdateStatus("完成", "");
+ await Task.Delay(500);
+ DialogResult = true;
+ }
+ catch (Exception ex)
+ {
+ UpdateStatus($"失败: {ex.Message}", "");
+ await Task.Delay(1500);
+ DialogResult = false;
+ }
+ Close();
+ }
+
+ public static async Task Show(Window owner, string title, Func action)
+ {
+ var dialog = new ProgressDialog();
+ dialog.Owner = owner;
+ dialog.Title = title;
+ dialog.Show();
+ await dialog.RunWithProgress(action);
+ return dialog.DialogResult ?? false;
+ }
+ }
+}
diff --git a/Better-EN5/UIItemManagerExtensions.cs b/Better-EN5/UIItemManagerExtensions.cs
index 9224273..5a00620 100644
--- a/Better-EN5/UIItemManagerExtensions.cs
+++ b/Better-EN5/UIItemManagerExtensions.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Threading;
@@ -15,22 +14,8 @@ namespace BetterEN5
manager.Append(c => item, attribute);
var purpose = attribute.Purposes[0];
- string menuName;
- if (purpose == UIItemPurposes.BoardEditMenu)
- {
- menuName = "BoardEditContextMenu";
- }
- else if (purpose == UIItemPurposes.HeadToolBar)
- {
- menuName = "HeadToolBar";
- }
- else
- {
- menuName = purpose.Replace(".", "_");
- }
-
- var itemLangKey = item.GetType().Name.Replace("MenuItem", "").Replace("HeadToolBar", "").Replace("ApplicationMenu", "").Replace("ExtendedTitleBar", "");
- var langKey = $"Lang.{menuName}.{itemLangKey}";
+ var prefix = purpose == UIItemPurposes.BoardEditMenu ? "BoardEditContextMenu" : purpose;
+ var key = $"Lang.{prefix}.{item.GetType().Name}";
Application.Current.Dispatcher.InvokeAsync(() =>
{
@@ -38,9 +23,9 @@ namespace BetterEN5
{
Lang.Sources.Add(new DictionaryLanguageSource
{
- [langInfo.CultureInfo] = new Dictionary()
+ [langInfo.CultureInfo] = new Dictionary
{
- { langKey, langInfo.LangText },
+ { key, langInfo.LangText }
},
});
}
diff --git a/Better-EN5/manifest.coin b/Better-EN5/manifest.coin
index 817e7e8..ef1e257 100644
--- a/Better-EN5/manifest.coin
+++ b/Better-EN5/manifest.coin
@@ -1,6 +1,6 @@
>
Description
-希沃白板功能增强插件 - 提供墨迹管理、文件转换增强和触摸检测修复功能
+雾生万象,启以为光 — 希沃白板功能增强插件
>
Id
BetterEN5
@@ -12,7 +12,7 @@ MinClientVersion
5.2.2.653
>
Name
-Better-EN5 增强模块
+Better-Seewo
>
NetEntryPoint
Better-EN5.dll