v1.1.0: 修复入口使用BoardEditMenu/HeadToolBar, 16:9横版UI重做, 进度条在操作时显示, 雾启工作室

This commit is contained in:
miao-moe
2026-06-28 03:17:55 +08:00
parent 2d35293f7c
commit baf07956e9
16 changed files with 413 additions and 630 deletions

View File

@@ -9,11 +9,11 @@
<AssemblyName>Better-EN5</AssemblyName>
<Version>1.1.0</Version>
<FileVersion>1.1.0</FileVersion>
<Authors>云汀</Authors>
<Author>云汀</Author>
<Company>云汀</Company>
<Authors>雾启工作室</Authors>
<Author>雾启工作室</Author>
<Company>雾启工作室</Company>
<Product>Better-Seewo 增强插件</Product>
<Description>希沃白板功能增强插件 - 墨迹管理、文件转换增强、触摸检测修复、大屏模式支持、专业版激活</Description>
<Description>雾生万象,启以为光 — 希沃白板功能增强插件</Description>
<UseEasiNote>all</UseEasiNote>
</PropertyGroup>
<ItemGroup>

View File

@@ -43,29 +43,22 @@ namespace BetterEN5
{
var manager = Container.Current.Get<IUIItemManager>();
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"),

View File

@@ -1,150 +0,0 @@
<UserControl x:Class="BetterEN5.UI.BetterEN5Module"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" d:DesignWidth="320" d:DesignHeight="600">
<UserControl.Resources>
<Style x:Key="CardBorder" TargetType="Border">
<Setter Property="Background" Value="{Binding ElementName=Root, Path=Resources[CardBackground]}"/>
<Setter Property="BorderBrush" Value="#20FFFFFF"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="10"/>
<Setter Property="Margin" Value="6,4"/>
<Setter Property="Padding" Value="12,10"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="8" ShadowDepth="2" Opacity="0.15" Color="Black"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ActionButton" TargetType="Button">
<Setter Property="Background" Value="#00FFFFFF"/>
<Setter Property="Foreground" Value="{Binding ElementName=Root, Path=Resources[Foreground]}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Padding" Value="8,6"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="6" Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="#15FFFFFF"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="#30FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Color x:Key="AccentColor">#60B0FF</Color>
<SolidColorBrush x:Key="CardBackground" Color="#1E1E2E"/>
<SolidColorBrush x:Key="Foreground" Color="#E0E0E0"/>
<SolidColorBrush x:Key="AccentBrush" Color="#60B0FF"/>
<SolidColorBrush x:Key="SubText" Color="#909090"/>
</UserControl.Resources>
<Border x:Name="Root" Background="#161625" CornerRadius="0">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="#1E1E30" BorderBrush="#30FFFFFF" BorderThickness="0,0,0,1"
CornerRadius="0" Padding="16,14">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="Better-EN5" FontSize="20" FontWeight="Medium"
Foreground="{StaticResource AccentBrush}"/>
<TextBlock Grid.Row="1" Text="希沃白板增强模块" FontSize="12"
Foreground="{StaticResource SubText}" Margin="0,2,0,0"/>
</Grid>
</Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled"
Padding="8,4" Margin="0">
<StackPanel>
<Border Style="{StaticResource CardBorder}">
<StackPanel>
<TextBlock Text="墨迹管理" FontSize="14" FontWeight="SemiBold"
Foreground="{StaticResource AccentBrush}" Margin="0,0,0,6"/>
<Button Content="📝 导出墨迹..." Style="{StaticResource ActionButton}" Click="ExportInk_Click"/>
<Button Content="📂 导入墨迹..." Style="{StaticResource ActionButton}" Click="ImportInk_Click"/>
<TextBlock x:Name="InkStatus" Text="" FontSize="11" Foreground="{StaticResource SubText}"
Margin="8,4,0,0"/>
</StackPanel>
</Border>
<Border Style="{StaticResource CardBorder}">
<StackPanel>
<TextBlock Text="文件转换" FontSize="14" FontWeight="SemiBold"
Foreground="{StaticResource AccentBrush}" Margin="0,0,0,6"/>
<Button Content="📄 PPT → ENBX" Style="{StaticResource ActionButton}" Click="ConvertPptx_Click"/>
<Button Content="📄 ENBX → PPT" Style="{StaticResource ActionButton}" Click="ConvertEnbx_Click"/>
<TextBlock x:Name="ConversionStatus" Text="" FontSize="11" Foreground="{StaticResource SubText}"
Margin="8,4,0,0"/>
</StackPanel>
</Border>
<Border Style="{StaticResource CardBorder}">
<StackPanel>
<TextBlock Text="触摸修复" FontSize="14" FontWeight="SemiBold"
Foreground="{StaticResource AccentBrush}" Margin="0,0,0,6"/>
<Button Content="🔍 检测触摸状态" Style="{StaticResource ActionButton}" Click="CheckTouch_Click"/>
<Button Content="🔧 应用触摸修复" Style="{StaticResource ActionButton}" Click="ApplyTouchFix_Click"/>
<TextBlock x:Name="TouchStatus" Text="" FontSize="11" Foreground="{StaticResource SubText}"
Margin="8,4,0,0"/>
</StackPanel>
</Border>
<Border Style="{StaticResource CardBorder}">
<StackPanel>
<TextBlock Text="大板支持" FontSize="14" FontWeight="SemiBold"
Foreground="{StaticResource AccentBrush}" Margin="0,0,0,6"/>
<TextBlock Text="为非触摸大屏启用完整白板模式" FontSize="11"
Foreground="{StaticResource SubText}" Margin="0,0,0,6"/>
<Button Content="🖥️ 配置大屏模式" Style="{StaticResource ActionButton}" Click="EnableBoardSupport_Click"/>
<Button Content="💻 启用 IWB 模式" Style="{StaticResource ActionButton}" Click="EnableIWB_Click"/>
<TextBlock x:Name="BoardStatus" Text="" FontSize="11" Foreground="{StaticResource SubText}"
Margin="8,4,0,0"/>
</StackPanel>
</Border>
<Border Style="{StaticResource CardBorder}">
<StackPanel>
<TextBlock Text="专业版 / 激活" FontSize="14" FontWeight="SemiBold"
Foreground="{StaticResource AccentBrush}" Margin="0,0,0,6"/>
<TextBlock x:Name="ActivationStatusText" Text="当前状态: 社区版" FontSize="11"
Foreground="{StaticResource SubText}" Margin="0,0,0,6"/>
<Button Content="🔑 输入激活码..." Style="{StaticResource ActionButton}" Click="ActivatePro_Click"/>
<Button Content="📦 打开注册补丁..." Style="{StaticResource ActionButton}" Click="LaunchInstaller_Click"/>
</StackPanel>
</Border>
</StackPanel>
</ScrollViewer>
<Border Grid.Row="2" Background="#1A1A2E" BorderBrush="#20FFFFFF" BorderThickness="0,1,0,0"
Padding="12,8" CornerRadius="0">
<TextBlock x:Name="FooterText" Text="v1.1.0 · 就绪" FontSize="11"
Foreground="{StaticResource SubText}" TextAlignment="Center"/>
</Border>
</Grid>
</Border>
</UserControl>

View File

@@ -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);
}
}
}
}

View File

@@ -1,107 +1,178 @@
<Window x:Class="BetterEN5.UI.BetterSeewoMainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="clr-namespace:BetterEN5.UI"
Title="Better-Seewo"
Width="960" Height="640"
MinWidth="720" MinHeight="480"
WindowStyle="None"
ResizeMode="CanResize"
AllowsTransparency="True"
Background="Transparent"
Width="960" Height="580"
MinWidth="800" MinHeight="480"
WindowStyle="None" ResizeMode="CanResize"
AllowsTransparency="True" Background="Transparent"
WindowStartupLocation="CenterScreen"
FontSize="14">
<Window.Resources>
<Color x:Key="WindowBackground">#0D0D1A</Color>
<SolidColorBrush x:Key="WindowBorderBrush" Color="#30FFFFFF"/>
<SolidColorBrush x:Key="TitleBarBackground" Color="#1A1A2E"/>
<SolidColorBrush x:Key="TitleBarForeground" Color="#C0C0D0"/>
<SolidColorBrush x:Key="GlowBrush" Color="#40FFFFFF"/>
<Storyboard x:Key="FadeInStoryboard">
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1"
Duration="0:0:0.4" EasingFunction="{StaticResource Easing}"/>
</Storyboard>
<Storyboard x:Key="ScaleInStoryboard">
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" From="0.95" To="1"
Duration="0:0:0.4" EasingFunction="{StaticResource Easing}"/>
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" From="0.95" To="1"
Duration="0:0:0.4" EasingFunction="{StaticResource Easing}"/>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1"
Duration="0:0:0.3" EasingFunction="{StaticResource Easing}"/>
</Storyboard>
<QuadraticEase x:Key="Easing" EasingMode="EaseOut"/>
<Color x:Key="Bg">#0F0F1A</Color>
<Color x:Key="CardBg">#1A1A2E</Color>
<Color x:Key="Accent">#60B0FF</Color>
<Color x:Key="Fg">#D0D0E0</Color>
<Color x:Key="SubFg">#707090</Color>
<SolidColorBrush x:Key="BorderBrush" Color="#25FFFFFF"/>
<QuadraticEase x:Key="EaseOut" EasingMode="EaseOut"/>
</Window.Resources>
<Window.RenderTransform>
<ScaleTransform ScaleX="1" ScaleY="1"/>
</Window.RenderTransform>
<Border CornerRadius="12" Background="#0D0D1A" BorderBrush="{StaticResource WindowBorderBrush}"
BorderThickness="1" Padding="0">
<Border CornerRadius="12" Background="#0F0F1A" BorderBrush="{StaticResource BorderBrush}"
BorderThickness="1">
<Border.Effect>
<DropShadowEffect BlurRadius="24" ShadowDepth="4" Opacity="0.3" Color="Black"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="36"/>
<RowDefinition Height="34"/>
<RowDefinition Height="*"/>
<RowDefinition Height="24"/>
<RowDefinition Height="26"/>
</Grid.RowDefinitions>
<Border Grid.Row="0" Background="{StaticResource TitleBarBackground}"
CornerRadius="12,12,0,0" Padding="0">
<!-- Title Bar -->
<Border Grid.Row="0" Background="#1A1A2E" CornerRadius="12,12,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="Better-Seewo" FontSize="13"
Foreground="{StaticResource TitleBarForeground}"
VerticalAlignment="Center" Margin="14,0,0,0"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" Margin="0,0,6,0">
<Button x:Name="MinimizeButton" Content="" Width="28" Height="24"
Foreground="{StaticResource TitleBarForeground}"
<StackPanel Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Center" Margin="12,0">
<TextBlock Text="✦" FontSize="12" Foreground="#60B0FF" VerticalAlignment="Center"/>
<TextBlock Text=" Better-Seewo" FontSize="13" Foreground="#C0C0D0" VerticalAlignment="Center"/>
</StackPanel>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button x:Name="MinBtn" Content="─" Width="28" Height="22"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Click="Minimize_Click"
FontSize="12" FontFamily="Arial"/>
<Button x:Name="MaximizeButton" Content="□" Width="28" Height="24"
Foreground="{StaticResource TitleBarForeground}"
Foreground="{StaticResource SubFg}" FontSize="12"
Cursor="Hand" Click="Minimize_Click"/>
<Button x:Name="MaxBtn" Content="□" Width="28" Height="22"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Click="Maximize_Click"
FontSize="12" FontFamily="Arial"/>
<Button x:Name="CloseButton" Content="✕" Width="28" Height="24"
Foreground="{StaticResource TitleBarForeground}"
Foreground="{StaticResource SubFg}" FontSize="12"
Cursor="Hand" Click="Maximize_Click"/>
<Button x:Name="CloseBtn" Content="✕" Width="28" Height="22"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Click="Close_Click"
FontSize="12" FontFamily="Arial"/>
Foreground="{StaticResource SubFg}" FontSize="12"
Cursor="Hand" Click="Close_Click"/>
</StackPanel>
</Grid>
</Border>
<Grid Grid.Row="1">
<!-- Content -->
<Grid Grid.Row="1" Margin="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" MinWidth="240" MaxWidth="400"/>
<ColumnDefinition Width="1" />
<ColumnDefinition Width="3*"/>
<ColumnDefinition Width="200"/>
<ColumnDefinition Width="1"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Sidebar -->
<Border Grid.Column="0" Background="#12121E">
<ui:BetterEN5Module x:Name="En5Module"/>
<StackPanel Margin="0,8">
<TextBlock Text="功能模块" FontSize="11" Foreground="{StaticResource SubFg}"
Margin="16,8,16,4"/>
<RadioButton x:Name="NavInk" GroupName="Nav" IsChecked="True"
Content=" 墨迹管理" Foreground="{StaticResource Fg}"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Height="36" Padding="16,0"
Checked="NavChanged"/>
<RadioButton x:Name="NavConvert" GroupName="Nav"
Content=" 文件转换" Foreground="{StaticResource Fg}"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Height="36" Padding="16,0"
Checked="NavChanged"/>
<RadioButton x:Name="NavTouch" GroupName="Nav"
Content=" 触摸修复" Foreground="{StaticResource Fg}"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Height="36" Padding="16,0"
Checked="NavChanged"/>
<RadioButton x:Name="NavBoard" GroupName="Nav"
Content=" 大屏支持" Foreground="{StaticResource Fg}"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Height="36" Padding="16,0"
Checked="NavChanged"/>
<RadioButton x:Name="NavActivate" GroupName="Nav"
Content=" 激活" Foreground="{StaticResource Fg}"
Background="Transparent" BorderThickness="0"
Cursor="Hand" Height="36" Padding="16,0"
Checked="NavChanged"/>
</StackPanel>
</Border>
<Border Grid.Column="1" Background="#252540" Width="1" Opacity="0.5"/>
<!-- Divider -->
<Rectangle Grid.Column="1" Fill="#252540" Width="1" Opacity="0.5"/>
<Border Grid.Column="2" Background="#0F0F1A">
<ui:ComingSoonModule/>
</Border>
<!-- Content Area -->
<ScrollViewer Grid.Column="2" VerticalScrollBarVisibility="Auto"
Background="#0D0D18" Padding="24,16">
<StackPanel x:Name="ContentPanel">
<!-- Ink Module -->
<StackPanel x:Name="PanelInk" Visibility="Visible">
<TextBlock Text="墨迹管理" FontSize="20" FontWeight="SemiBold"
Foreground="#60B0FF" Margin="0,0,0,16"/>
<TextBlock Text="导出/导入希沃白板课件中的笔迹和标注" FontSize="13"
Foreground="{StaticResource SubFg}" Margin="0,0,0,16"/>
<Button Content="导出墨迹..." Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="ExportInk_Click"/>
<Button Content="导入墨迹..." Width="180" Height="34" Margin="0,0,8,8" Cursor="Hand" Click="ImportInk_Click"/>
<TextBlock x:Name="InkStatus" FontSize="12" Foreground="{StaticResource SubFg}" Margin="0,8,0,0"/>
</StackPanel>
<!-- Convert Module -->
<StackPanel x:Name="PanelConvert" Visibility="Collapsed">
<TextBlock Text="文件转换" FontSize="20" FontWeight="SemiBold"
Foreground="#60B0FF" Margin="0,0,0,16"/>
<TextBlock Text="PPT 与 ENBX 格式互转" FontSize="13"
Foreground="{StaticResource SubFg}" Margin="0,0,0,16"/>
<Button Content="PPT → ENBX" Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="ConvertPptx_Click"/>
<Button Content="ENBX → PPT" Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="ConvertEnbx_Click"/>
<TextBlock x:Name="ConvertStatus" FontSize="12" Foreground="{StaticResource SubFg}" Margin="0,8,0,0"/>
</StackPanel>
<!-- Touch Module -->
<StackPanel x:Name="PanelTouch" Visibility="Collapsed">
<TextBlock Text="触摸修复" FontSize="20" FontWeight="SemiBold"
Foreground="#60B0FF" Margin="0,0,0,16"/>
<TextBlock Text="修复希沃白板在非希沃硬件上的触摸检测问题" FontSize="13"
Foreground="{StaticResource SubFg}" Margin="0,0,0,16"/>
<Button Content="检测触摸状态" Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="CheckTouch_Click"/>
<Button Content="应用修复" Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="ApplyTouchFix_Click"/>
<TextBlock x:Name="TouchStatus" FontSize="12" Foreground="{StaticResource SubFg}" Margin="0,8,0,0"/>
</StackPanel>
<!-- Board Module -->
<StackPanel x:Name="PanelBoard" Visibility="Collapsed">
<TextBlock Text="大屏支持" FontSize="20" FontWeight="SemiBold"
Foreground="#60B0FF" Margin="0,0,0,16"/>
<TextBlock Text="为非触摸大屏启用完整白板模式" FontSize="13"
Foreground="{StaticResource SubFg}" Margin="0,0,0,16"/>
<Button Content="配置大屏模式" Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="EnableBoardSupport_Click"/>
<Button Content="启用 IWB 模式" Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="EnableIWB_Click"/>
<TextBlock x:Name="BoardStatus" FontSize="12" Foreground="{StaticResource SubFg}" Margin="0,8,0,0"/>
</StackPanel>
<!-- Activate Module -->
<StackPanel x:Name="PanelActivate" Visibility="Collapsed">
<TextBlock Text="专业版激活" FontSize="20" FontWeight="SemiBold"
Foreground="#60B0FF" Margin="0,0,0,16"/>
<TextBlock x:Name="ActivationStatusText" Text="当前状态: 社区版" FontSize="13"
Foreground="{StaticResource SubFg}" Margin="0,0,0,16"/>
<Button Content="输入激活码..." Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="ActivatePro_Click"/>
<Button Content="打开注册补丁..." Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="LaunchInstaller_Click"/>
<Button Content="检测激活状态" Width="180" Height="34" Margin="0,0,0,8" Cursor="Hand" Click="CheckActivation_Click"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
<Border Grid.Row="2" Background="{StaticResource TitleBarBackground}"
CornerRadius="0,0,12,12" Padding="0">
<TextBlock Text="Better-Seewo v1.1.0 · 希沃白板增强插件" FontSize="11"
Foreground="#505060" HorizontalAlignment="Center" VerticalAlignment="Center"/>
<!-- Footer -->
<Border Grid.Row="2" Background="#1A1A2E" CornerRadius="0,0,12,12">
<TextBlock Text="雾启工作室 · 雾生万象,启以为光" FontSize="11"
Foreground="#404058" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</Grid>
</Border>

View File

@@ -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<BetterSeewoMainWindow>().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<BetterSeewoMainWindow>().FirstOrDefault();
if (w != null) { w.Activate(); return; }
new BetterSeewoMainWindow().Show();
});
}
}

View File

@@ -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(() =>

View File

@@ -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(() =>

View File

@@ -1,105 +0,0 @@
<UserControl x:Class="BetterEN5.UI.ComingSoonModule"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" d:DesignWidth="700" d:DesignHeight="600">
<UserControl.Resources>
<Style x:Key="ModuleCard" TargetType="Border">
<Setter Property="Background" Value="#1A1A2E"/>
<Setter Property="BorderBrush" Value="#15FFFFFF"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="14"/>
<Setter Property="Margin" Value="10,8"/>
<Setter Property="Padding" Value="20"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect BlurRadius="12" ShadowDepth="3" Opacity="0.12" Color="Black"/>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PlaceholderIcon" TargetType="TextBlock">
<Setter Property="FontSize" Value="36"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,0,8"/>
</Style>
<Style x:Key="PlaceholderTitle" TargetType="TextBlock">
<Setter Property="FontSize" Value="16"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="#A0C4FF"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,0,4"/>
</Style>
<Style x:Key="PlaceholderDesc" TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
<Setter Property="Foreground" Value="#707090"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="TextAlignment" Value="Center"/>
</Style>
</UserControl.Resources>
<Border Background="#12121E" CornerRadius="0" Padding="16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="🚀 更多功能即将到来" FontSize="22" FontWeight="Light"
Foreground="#8080A0" HorizontalAlignment="Center" Margin="0,16,0,4"/>
<TextBlock Grid.Row="1" Text="敬请期待 · Coming Soon" FontSize="13"
Foreground="#505068" HorizontalAlignment="Center" Margin="0,0,0,16"/>
<UniformGrid Grid.Row="2" Columns="2" Margin="0,0,0,0">
<Border Style="{StaticResource ModuleCard}">
<StackPanel VerticalAlignment="Center">
<TextBlock Text="🎨" Style="{StaticResource PlaceholderIcon}"/>
<TextBlock Text="自定义皮肤" Style="{StaticResource PlaceholderTitle}"/>
<TextBlock Text="随心更换希沃白板界面主题与配色" Style="{StaticResource PlaceholderDesc}"/>
</StackPanel>
</Border>
<Border Style="{StaticResource ModuleCard}">
<StackPanel VerticalAlignment="Center">
<TextBlock Text="📚" Style="{StaticResource PlaceholderIcon}"/>
<TextBlock Text="资源管理器" Style="{StaticResource PlaceholderTitle}"/>
<TextBlock Text="一站式管理课件、图片、音视频资源" Style="{StaticResource PlaceholderDesc}"/>
</StackPanel>
</Border>
<Border Style="{StaticResource ModuleCard}">
<StackPanel VerticalAlignment="Center">
<TextBlock Text="📋" Style="{StaticResource PlaceholderIcon}"/>
<TextBlock Text="模板库" Style="{StaticResource PlaceholderTitle}"/>
<TextBlock Text="海量精美课件模板,一键套用" Style="{StaticResource PlaceholderDesc}"/>
</StackPanel>
</Border>
<Border Style="{StaticResource ModuleCard}">
<StackPanel VerticalAlignment="Center">
<TextBlock Text="🔌" Style="{StaticResource PlaceholderIcon}"/>
<TextBlock Text="插件市场" Style="{StaticResource PlaceholderTitle}"/>
<TextBlock Text="发现并安装更多社区插件扩展" Style="{StaticResource PlaceholderDesc}"/>
</StackPanel>
</Border>
<Border Style="{StaticResource ModuleCard}">
<StackPanel VerticalAlignment="Center">
<TextBlock Text="☁️" Style="{StaticResource PlaceholderIcon}"/>
<TextBlock Text="云同步" Style="{StaticResource PlaceholderTitle}"/>
<TextBlock Text="跨设备课件与设置云端同步" Style="{StaticResource PlaceholderDesc}"/>
</StackPanel>
</Border>
<Border Style="{StaticResource ModuleCard}">
<StackPanel VerticalAlignment="Center">
<TextBlock Text="🤖" Style="{StaticResource PlaceholderIcon}"/>
<TextBlock Text="AI 助手" Style="{StaticResource PlaceholderTitle}"/>
<TextBlock Text="智能备课、AI 生成课件内容" Style="{StaticResource PlaceholderDesc}"/>
</StackPanel>
</Border>
</UniformGrid>
<TextBlock Grid.Row="3" Text="Better-Seewo · 为更好的教学体验" FontSize="12"
Foreground="#404058" HorizontalAlignment="Center" Margin="0,12,0,8"/>
</Grid>
</Border>
</UserControl>

View File

@@ -1,12 +0,0 @@
using System.Windows.Controls;
namespace BetterEN5.UI
{
public partial class ComingSoonModule : UserControl
{
public ComingSoonModule()
{
InitializeComponent();
}
}
}

View File

@@ -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;
}
}
}

View File

@@ -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(() =>

View File

@@ -0,0 +1,27 @@
<Window x:Class="BetterEN5.UI.ProgressDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="操作进度" Height="160" Width="420"
WindowStartupLocation="CenterOwner"
WindowStyle="None" ResizeMode="NoResize"
AllowsTransparency="True" Background="Transparent">
<Border CornerRadius="10" Background="#1E1E2E" BorderBrush="#30FFFFFF" BorderThickness="1">
<Border.Effect>
<DropShadowEffect BlurRadius="16" ShadowDepth="3" Opacity="0.3" Color="Black"/>
</Border.Effect>
<Grid Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" x:Name="StatusText" Text="正在操作..." FontSize="14"
Foreground="#C0C0D0" Margin="0,0,0,12"/>
<ProgressBar Grid.Row="1" x:Name="ProgressBar" Height="6"
IsIndeterminate="True" Foreground="#60B0FF"
Background="#2A2A3E" BorderThickness="0"/>
<TextBlock Grid.Row="2" x:Name="DetailText" Text="" FontSize="11"
Foreground="#707090" Margin="0,8,0,0"/>
</Grid>
</Border>
</Window>

View File

@@ -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<ProgressDialog, Task> 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<bool> Show(Window owner, string title, Func<ProgressDialog, Task> action)
{
var dialog = new ProgressDialog();
dialog.Owner = owner;
dialog.Title = title;
dialog.Show();
await dialog.RunWithProgress(action);
return dialog.DialogResult ?? false;
}
}
}

View File

@@ -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<string, string>()
[langInfo.CultureInfo] = new Dictionary<string, string>
{
{ langKey, langInfo.LangText },
{ key, langInfo.LangText }
},
});
}

View File

@@ -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