Compare commits
12 Commits
net6
...
feat/quickreport
| Author | SHA1 | Date | |
|---|---|---|---|
| a56f6d6775 | |||
| 281b5da1c8 | |||
| 0d4938971b | |||
| ae6268e8e3 | |||
| 9bcdc56a45 | |||
| 08f92685cb | |||
| 7cba03d1b9 | |||
| f60e77d39f | |||
| 3e8b90360d | |||
| 337d2f53e4 | |||
| 956f3b12ac | |||
| f9f4e20c65 |
@@ -0,0 +1,80 @@
|
||||
<UserControl
|
||||
x:Class="Ink_Canvas.Windows.FeedbackPages.FeedbackPage1"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="600">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" IsManipulationEnabled="True" PanningMode="VerticalOnly">
|
||||
<ikw:SimpleStackPanel Spacing="12">
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Margin="0,0,0,10" Text="选择要包含的信息"/>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderSoftware" Header="软件信息"
|
||||
Description="选择要包含在反馈中的软件版本信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AppIconDefault}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckAppVersion" IsChecked="True" Content="软件版本"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckUpdateChannel" IsChecked="True" Content="更新通道"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderSystem" Header="系统信息"
|
||||
Description="选择要包含在反馈中的系统环境信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.PC1}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckOSVersion" IsChecked="True" Content="操作系统版本"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckNetVersion" IsChecked="True" Content=".NET Framework 版本"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckTouchSupport" IsChecked="True" Content="触控支持"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderDevice" Header="设备信息"
|
||||
Description="选择要包含在反馈中的设备标识信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Devices2}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckDeviceId" IsChecked="False" Content="设备 ID"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard x:Name="CardFanceId" ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckFanceId" IsChecked="False" Content="遥测 ID" ToolTipService.ShowOnDisabled="True">
|
||||
</CheckBox>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderConfiguration" Header="软件配置"
|
||||
Description="选择要包含在反馈中的软件配置信息">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckPPTLinkage" IsChecked="True" Content="PPT 联动设置"/>
|
||||
</ui:SettingsCard>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<CheckBox x:Name="CheckInkRecognition" IsChecked="True" Content="墨迹识别设置"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.FeedbackPages
|
||||
{
|
||||
/// <summary>
|
||||
/// 反馈页面1:环境信息选择页面。
|
||||
/// 允许用户选择要包含在反馈中的系统环境信息。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 用户可以选择包含以下信息:
|
||||
/// - 软件版本和更新通道
|
||||
/// - 操作系统版本、.NET版本和触控支持
|
||||
/// - 设备ID和遥测ID
|
||||
/// - PPT联动设置和墨迹识别设置
|
||||
/// </remarks>
|
||||
public partial class FeedbackPage1 : UserControl
|
||||
{
|
||||
public FeedbackPage1()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<UserControl
|
||||
x:Class="Ink_Canvas.Windows.FeedbackPages.FeedbackPage2"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="600">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" IsManipulationEnabled="True" PanningMode="VerticalOnly">
|
||||
<ikw:SimpleStackPanel Spacing="12" Margin="0,0,0,20">
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Margin="0,0,0,10" Text="确认要发送的信息"/>
|
||||
|
||||
<ui:SettingsCard Header="软件信息"
|
||||
Description="将要包含在反馈中的软件版本信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.AppIconDefault}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextAppVersionInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="系统信息"
|
||||
Description="将要包含在反馈中的系统环境信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.PC1}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextSystemInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard Header="设备信息"
|
||||
Description="将要包含在反馈中的设备标识信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Devices2}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextDeviceInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
<TextBlock x:Name="TextTelemetryInfo" Text="" FontSize="14" TextWrapping="Wrap" Visibility="Collapsed"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
|
||||
<ui:SettingsCard x:Name="CardConfiguration" Header="软件配置"
|
||||
Description="将要包含在反馈中的软件配置信息">
|
||||
<ui:SettingsCard.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Settings}"/>
|
||||
</ui:SettingsCard.HeaderIcon>
|
||||
<ikw:SimpleStackPanel Spacing="8">
|
||||
<TextBlock x:Name="TextConfigurationInfo" Text="" FontSize="14" TextWrapping="Wrap"/>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ui:SettingsCard>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.FeedbackPages
|
||||
{
|
||||
/// <summary>
|
||||
/// 反馈页面2:环境信息预览页面。
|
||||
/// 展示用户选择要包含在反馈中的系统环境信息。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 显示以下信息:
|
||||
/// - 软件版本信息
|
||||
/// - 系统信息(操作系统、.NET版本、触控支持)
|
||||
/// - 设备信息(设备ID、遥测ID)
|
||||
/// - 软件配置信息(PPT联动设置、墨迹识别设置)
|
||||
/// </remarks>
|
||||
public partial class FeedbackPage2 : UserControl
|
||||
{
|
||||
public FeedbackPage2()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<UserControl
|
||||
x:Class="Ink_Canvas.Windows.FeedbackPages.FeedbackPage3"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="600">
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled" IsManipulationEnabled="True" PanningMode="VerticalOnly">
|
||||
<ikw:SimpleStackPanel Spacing="12" Margin="0,0,0,20">
|
||||
<TextBlock FontSize="20" FontWeight="SemiBold" Margin="0,0,0,10" Text="选择反馈方式"/>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderGitHubFeedback" Header="GitHub 问题反馈"
|
||||
Description="在 GitHub 上提交问题反馈">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Mail}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<Button x:Name="BtnOpenGitHubIssue" Content="跳转到 GitHub 反馈">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.AccentButtonStyleKey}}"/>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard x:Name="CardCopyIssueUrl" Header="复制反馈链接" IsClickEnabled="True">
|
||||
<ui:SettingsCard.ActionIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Copy}"/>
|
||||
</ui:SettingsCard.ActionIcon>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
|
||||
<ui:SettingsExpander x:Name="ExpanderMarkdownTemplate" Header="反馈模板 (Markdown)"
|
||||
Description="复制以下 Markdown 模板进行反馈">
|
||||
<ui:SettingsExpander.HeaderIcon>
|
||||
<ui:FontIcon Icon="{x:Static ui:SegoeFluentIcons.Code}"/>
|
||||
</ui:SettingsExpander.HeaderIcon>
|
||||
<Button x:Name="BtnCopyMarkdown" Content="复制模板">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.DefaultButtonStyleKey}}"/>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<ui:SettingsExpander.Items>
|
||||
<ui:SettingsCard ContentAlignment="Left">
|
||||
<TextBox x:Name="TextBoxMarkdownTemplate"
|
||||
MinHeight="200"
|
||||
IsReadOnly="True"
|
||||
BorderThickness="0"
|
||||
Background="Transparent"
|
||||
FontFamily="Consolas"
|
||||
FontSize="12"
|
||||
TextWrapping="Wrap"
|
||||
AcceptsReturn="True"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Text="# 问题描述
请描述您遇到的问题...

# 重现步骤
1. 
2. 
3. 

# 预期行为
请描述您期望的行为...

# 实际行为
请描述实际发生的...

# 环境信息
- 版本: 
- 系统: 
"/>
|
||||
</ui:SettingsCard>
|
||||
</ui:SettingsExpander.Items>
|
||||
</ui:SettingsExpander>
|
||||
</ikw:SimpleStackPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace Ink_Canvas.Windows.FeedbackPages
|
||||
{
|
||||
/// <summary>
|
||||
/// 反馈页面3:反馈提交页面。
|
||||
/// 提供Markdown模板并允许用户复制或直接打开GitHub Issue页面。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 页面提供以下功能:
|
||||
/// - 显示生成的Markdown格式环境信息模板
|
||||
/// - 复制Markdown模板到剪贴板
|
||||
/// - 复制预填的GitHub Issue URL到剪贴板
|
||||
/// - 直接在浏览器中打开GitHub Issue创建页面
|
||||
/// </remarks>
|
||||
public partial class FeedbackPage3 : UserControl
|
||||
{
|
||||
public event EventHandler<RoutedEventArgs> BtnOpenGitHubIssueClick;
|
||||
public event EventHandler<RoutedEventArgs> CardCopyIssueUrlClick;
|
||||
public event EventHandler<RoutedEventArgs> BtnCopyMarkdownClick;
|
||||
|
||||
public string MarkdownTemplate => TextBoxMarkdownTemplate.Text;
|
||||
|
||||
public FeedbackPage3()
|
||||
{
|
||||
InitializeComponent();
|
||||
BtnOpenGitHubIssue.Click += (s, e) => BtnOpenGitHubIssueClick?.Invoke(this, e);
|
||||
CardCopyIssueUrl.Click += (s, e) => CardCopyIssueUrlClick?.Invoke(this, e);
|
||||
BtnCopyMarkdown.Click += (s, e) => BtnCopyMarkdownClick?.Invoke(this, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
<Window x:Class="Ink_Canvas.FeedbackWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:Ink_Canvas"
|
||||
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
|
||||
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
|
||||
xmlns:feedbackPages="clr-namespace:Ink_Canvas.Windows.FeedbackPages"
|
||||
mc:Ignorable="d" Topmost="True" WindowStartupLocation="CenterScreen" ui:WindowHelper.UseModernWindowStyle="True"
|
||||
ResizeMode="NoResize" ui:ThemeManager.RequestedTheme="Light"
|
||||
Title="反馈问题 - Ink Canvas For Class CE" Height="550" Width="650" FontFamily="Microsoft YaHei UI">
|
||||
<Grid Margin="30">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<ui:Frame x:Name="ContentFrame" Grid.Row="0">
|
||||
<ui:Frame.ContentTransitions>
|
||||
<ui:TransitionCollection>
|
||||
<ui:NavigationThemeTransition />
|
||||
</ui:TransitionCollection>
|
||||
</ui:Frame.ContentTransitions>
|
||||
</ui:Frame>
|
||||
|
||||
<Grid Grid.Row="1" VerticalAlignment="Bottom" Margin="0,20,0,0">
|
||||
<ikw:SimpleStackPanel HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal" Spacing="12">
|
||||
<Button x:Name="ButtonCancel" Content="取消" Width="100" Height="36" FontFamily="Microsoft YaHei UI" FontSize="14" Click="ButtonCancel_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.DefaultButtonStyleKey}}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"/>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button x:Name="ButtonNext" Content="下一步" Width="120" Height="36" FontFamily="Microsoft YaHei UI" FontSize="14" FontWeight="SemiBold" Click="ButtonNext_Click">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.AccentButtonStyleKey}}"/>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button x:Name="ButtonBack" Content="上一页" Width="100" Height="36" FontFamily="Microsoft YaHei UI" FontSize="14" Click="ButtonBack_Click" Visibility="Collapsed">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.DefaultButtonStyleKey}}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"/>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button x:Name="ButtonConfirm" Content="确认" Width="120" Height="36" FontFamily="Microsoft YaHei UI" FontSize="14" FontWeight="SemiBold" Click="ButtonConfirm_Click" Visibility="Collapsed">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button" BasedOn="{StaticResource {x:Static ui:ThemeKeys.AccentButtonStyleKey}}"/>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</ikw:SimpleStackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
@@ -0,0 +1,752 @@
|
||||
using Ink_Canvas.Helpers;
|
||||
using Ink_Canvas.Windows.FeedbackPages;
|
||||
using iNKORE.UI.WPF.Modern.Media.Animation;
|
||||
using OSVersionExtension;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
/// <summary>
|
||||
/// 反馈窗口,提供用户反馈和问题报告功能。
|
||||
/// 收集系统环境信息并生成GitHub Issue的Markdown模板。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 窗口包含三个页面:
|
||||
/// - FeedbackPage1: 选择要包含的环境信息
|
||||
/// - FeedbackPage2: 预览收集的环境信息
|
||||
/// - FeedbackPage3: 生成并复制Markdown模板或打开GitHub Issue
|
||||
/// </remarks>
|
||||
public partial class FeedbackWindow : Window
|
||||
{
|
||||
private string _appVersion = "";
|
||||
private string _updateChannel = "";
|
||||
private string _osVersion = "";
|
||||
private string _netVersion = "";
|
||||
private string _touchSupport = "";
|
||||
private string _deviceId = "";
|
||||
private string _telemetryId = "";
|
||||
private string _pptLinkageSettings = "";
|
||||
private string _inkRecognitionSettings = "";
|
||||
private string _inkRecognitionEngine = "";
|
||||
|
||||
private FeedbackPage1 _page1;
|
||||
private FeedbackPage2 _page2;
|
||||
private FeedbackPage3 _page3;
|
||||
|
||||
private NavigationTransitionInfo _transitionInfo = new SlideNavigationTransitionInfo() { Effect = SlideNavigationTransitionEffect.FromRight };
|
||||
|
||||
/// <summary>
|
||||
/// 构造函数,初始化反馈窗口并加载系统信息。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 初始化操作包括:
|
||||
/// 1. 初始化UI组件
|
||||
/// 2. 创建三个反馈页面实例
|
||||
/// 3. 绑定页面3的事件处理器
|
||||
/// 4. 加载系统环境信息(版本、系统、触控等)
|
||||
/// 5. 检查遥测ID可用性
|
||||
/// 6. 导航到第一页
|
||||
/// </remarks>
|
||||
public FeedbackWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
_page1 = new FeedbackPage1();
|
||||
_page2 = new FeedbackPage2();
|
||||
_page3 = new FeedbackPage3();
|
||||
|
||||
_page3.BtnOpenGitHubIssueClick += BtnOpenGitHubIssue_Click;
|
||||
_page3.CardCopyIssueUrlClick += CardCopyIssueUrl_Click;
|
||||
_page3.BtnCopyMarkdownClick += BtnCopyMarkdown_Click;
|
||||
|
||||
ContentFrame.Navigated += ContentFrame_Navigated;
|
||||
LoadInformation();
|
||||
CheckTelemetryIdAvailability();
|
||||
ContentFrame.Navigate(_page1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 内容框架导航事件处理器,用于更新按钮可见性。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">导航事件参数</param>
|
||||
private void ContentFrame_Navigated(object sender, System.Windows.Navigation.NavigationEventArgs e)
|
||||
{
|
||||
UpdateButtonVisibility();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载系统环境信息,包括软件版本、系统信息、设备信息等。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 收集的信息包括:
|
||||
/// - 软件版本和更新通道
|
||||
/// - 操作系统版本和.NET版本
|
||||
/// - 触控支持情况和触摸设备数量
|
||||
/// - 设备ID
|
||||
/// - 遥测ID
|
||||
/// - PPT联动设置
|
||||
/// - 墨迹识别设置和识别引擎
|
||||
/// </remarks>
|
||||
private void LoadInformation()
|
||||
{
|
||||
try
|
||||
{
|
||||
var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
_appVersion = $"v{assemblyVersion}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_appVersion = "未知";
|
||||
System.Diagnostics.Debug.WriteLine($"获取软件版本失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (MainWindow.Settings?.Startup != null)
|
||||
{
|
||||
_updateChannel = MainWindow.Settings.Startup.UpdateChannel.ToString();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_updateChannel = "未知";
|
||||
System.Diagnostics.Debug.WriteLine($"获取更新通道失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_osVersion = $"{OSVersion.GetOperatingSystem()} {OSVersion.GetOSVersion().Version}";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_osVersion = "未知";
|
||||
System.Diagnostics.Debug.WriteLine($"获取系统版本失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_netVersion = RuntimeInformation.FrameworkDescription;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_netVersion = "未知";
|
||||
System.Diagnostics.Debug.WriteLine($"获取.NET版本失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var support = Ink_Canvas.Windows.SettingsViews.AboutPanel.TouchTabletDetectHelper.IsTouchEnabled();
|
||||
var touchcount = Ink_Canvas.Windows.SettingsViews.AboutPanel.TouchTabletDetectHelper.GetTouchTabletDevices().Count;
|
||||
if (support)
|
||||
{
|
||||
if (touchcount > 0)
|
||||
{
|
||||
_touchSupport = $"支持({touchcount}个设备)";
|
||||
}
|
||||
else
|
||||
{
|
||||
_touchSupport = "支持";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_touchSupport = "不支持";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_touchSupport = "未知";
|
||||
System.Diagnostics.Debug.WriteLine($"获取触控支持失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_deviceId = DeviceIdentifier.GetDeviceId();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_deviceId = "获取失败";
|
||||
System.Diagnostics.Debug.WriteLine($"获取设备ID失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_telemetryId = GetTelemetryId();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_telemetryId = "获取失败";
|
||||
System.Diagnostics.Debug.WriteLine($"获取遥测ID失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (MainWindow.Settings?.PowerPointSettings != null)
|
||||
{
|
||||
_pptLinkageSettings = $"启用PPT联动: {MainWindow.Settings.PowerPointSettings.PowerPointSupport}\n";
|
||||
_pptLinkageSettings += $"WPS支持: {MainWindow.Settings.PowerPointSettings.IsSupportWPS}\n";
|
||||
_pptLinkageSettings += $"MSO支持: {MainWindow.Settings.PowerPointSettings.PowerPointSupport}\n";
|
||||
_pptLinkageSettings += $"Rot联动: {MainWindow.Settings.PowerPointSettings.UseRotPptLink}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
_pptLinkageSettings = "未配置PPT联动设置";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_pptLinkageSettings = "获取PPT联动设置失败";
|
||||
System.Diagnostics.Debug.WriteLine($"获取PPT联动设置失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (MainWindow.Settings?.InkToShape != null)
|
||||
{
|
||||
_inkRecognitionSettings = $"启用墨迹识别: {MainWindow.Settings.InkToShape.IsInkToShapeEnabled}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
_inkRecognitionSettings = "未配置墨迹识别设置";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_inkRecognitionSettings = "获取墨迹识别设置失败";
|
||||
System.Diagnostics.Debug.WriteLine($"获取墨迹识别设置失败: {ex.Message}");
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (MainWindow.Settings?.InkToShape != null)
|
||||
{
|
||||
var engineMode = Helpers.ShapeRecognitionRouter.FromSettingsInt(MainWindow.Settings.InkToShape.ShapeRecognitionEngine);
|
||||
bool useWinRT = Helpers.ShapeRecognitionRouter.ResolveUseWinRt(engineMode);
|
||||
_inkRecognitionEngine = useWinRT ? "WinRT" : "IACore";
|
||||
_inkRecognitionSettings += $"识别引擎: {_inkRecognitionEngine}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
_inkRecognitionEngine = "未配置";
|
||||
_inkRecognitionSettings += $"识别引擎: {_inkRecognitionEngine}\n";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_inkRecognitionEngine = "获取失败";
|
||||
_inkRecognitionSettings += $"识别引擎: {_inkRecognitionEngine}\n";
|
||||
System.Diagnostics.Debug.WriteLine($"获取墨迹识别引擎失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取存储在文件中的遥测ID。
|
||||
/// </summary>
|
||||
/// <returns>遥测ID字符串,如果不存在则返回空字符串</returns>
|
||||
private string GetTelemetryId()
|
||||
{
|
||||
try
|
||||
{
|
||||
var telemetryIdFilePath = System.IO.Path.Combine(App.RootPath, "telemetry_id.dat");
|
||||
if (System.IO.File.Exists(telemetryIdFilePath))
|
||||
{
|
||||
return System.IO.File.ReadAllText(telemetryIdFilePath).Trim();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查遥测ID是否可用,如果不可用则禁用相关复选框。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 检查telemetry_id.dat文件是否存在,如果不存在则禁用"包含遥测ID"选项
|
||||
/// </remarks>
|
||||
private void CheckTelemetryIdAvailability()
|
||||
{
|
||||
try
|
||||
{
|
||||
bool hasTelemetryId = CheckTelemetryIdExists();
|
||||
if (!hasTelemetryId)
|
||||
{
|
||||
_page1.CheckFanceId.IsChecked = false;
|
||||
_page1.CheckFanceId.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"检查遥测ID可用性失败: {ex.Message}");
|
||||
_page1.CheckFanceId.IsChecked = false;
|
||||
_page1.CheckFanceId.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 检查遥测ID文件是否存在。
|
||||
/// </summary>
|
||||
/// <returns>如果遥测ID文件存在返回true,否则返回false</returns>
|
||||
private bool CheckTelemetryIdExists()
|
||||
{
|
||||
try
|
||||
{
|
||||
var telemetryIdFilePath = System.IO.Path.Combine(App.RootPath, "telemetry_id.dat");
|
||||
return System.IO.File.Exists(telemetryIdFilePath);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 取消按钮点击事件处理器,关闭反馈窗口。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
private void ButtonCancel_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 返回按钮点击事件处理器,返回上一页面。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
private void ButtonBack_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (ContentFrame.BackStackDepth > 0)
|
||||
{
|
||||
ContentFrame.GoBack();
|
||||
UpdateButtonVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 下一步按钮点击事件处理器,导航到第二页并更新页面信息。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
private void ButtonNext_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UpdatePage2Info();
|
||||
ContentFrame.Navigate(_page2, null, _transitionInfo);
|
||||
UpdateButtonVisibility();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 确认按钮点击事件处理器,生成Markdown模板并导航到第三页。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
private void ButtonConfirm_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
GenerateMarkdownTemplate();
|
||||
ContentFrame.Navigate(_page3, null, _transitionInfo);
|
||||
UpdateButtonVisibility();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据当前页面更新按钮的可见性。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// - 第一页:显示"取消"和"下一步"按钮
|
||||
/// - 第二页:显示"返回"和"确认"按钮
|
||||
/// - 第三页:显示"返回"按钮
|
||||
/// </remarks>
|
||||
private void UpdateButtonVisibility()
|
||||
{
|
||||
if (ContentFrame.Content == _page1)
|
||||
{
|
||||
ButtonCancel.Visibility = Visibility.Visible;
|
||||
ButtonNext.Visibility = Visibility.Visible;
|
||||
ButtonBack.Visibility = Visibility.Collapsed;
|
||||
ButtonConfirm.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
else if (ContentFrame.Content == _page2)
|
||||
{
|
||||
ButtonCancel.Visibility = Visibility.Collapsed;
|
||||
ButtonNext.Visibility = Visibility.Collapsed;
|
||||
ButtonBack.Visibility = Visibility.Visible;
|
||||
ButtonConfirm.Visibility = Visibility.Visible;
|
||||
}
|
||||
else if (ContentFrame.Content == _page3)
|
||||
{
|
||||
ButtonCancel.Visibility = Visibility.Collapsed;
|
||||
ButtonNext.Visibility = Visibility.Collapsed;
|
||||
ButtonBack.Visibility = Visibility.Visible;
|
||||
ButtonConfirm.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新第二页的显示信息,将用户选择的环境信息展示在页面上。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 根据第一页用户的复选框选择情况,更新以下信息:
|
||||
/// - 软件版本信息
|
||||
/// - 系统信息(操作系统、.NET版本、触控支持)
|
||||
/// - 设备ID
|
||||
/// - 遥测ID
|
||||
/// - 软件配置信息(PPT联动设置、墨迹识别设置)
|
||||
/// </remarks>
|
||||
private void UpdatePage2Info()
|
||||
{
|
||||
try
|
||||
{
|
||||
string versionInfo = "";
|
||||
string systemInfo = "";
|
||||
|
||||
if (_page1.CheckAppVersion.IsChecked == true || _page1.CheckUpdateChannel.IsChecked == true)
|
||||
{
|
||||
if (_page1.CheckAppVersion.IsChecked == true)
|
||||
{
|
||||
versionInfo += _appVersion;
|
||||
}
|
||||
if (_page1.CheckUpdateChannel.IsChecked == true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(versionInfo))
|
||||
{
|
||||
versionInfo += " ";
|
||||
}
|
||||
versionInfo += $"({_updateChannel})";
|
||||
}
|
||||
}
|
||||
|
||||
if (_page1.CheckOSVersion.IsChecked == true || _page1.CheckNetVersion.IsChecked == true || _page1.CheckTouchSupport.IsChecked == true)
|
||||
{
|
||||
if (_page1.CheckOSVersion.IsChecked == true)
|
||||
{
|
||||
systemInfo += _osVersion;
|
||||
}
|
||||
if (_page1.CheckNetVersion.IsChecked == true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(systemInfo))
|
||||
{
|
||||
systemInfo += " | ";
|
||||
}
|
||||
systemInfo += _netVersion;
|
||||
}
|
||||
if (_page1.CheckTouchSupport.IsChecked == true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(systemInfo))
|
||||
{
|
||||
systemInfo += " | ";
|
||||
}
|
||||
systemInfo += $"触控:{_touchSupport}";
|
||||
}
|
||||
}
|
||||
|
||||
_page2.TextAppVersionInfo.Text = versionInfo;
|
||||
_page2.TextSystemInfo.Text = systemInfo;
|
||||
|
||||
if (_page1.CheckDeviceId.IsChecked == true)
|
||||
{
|
||||
_page2.TextDeviceInfo.Text = $"设备ID: {_deviceId}";
|
||||
}
|
||||
else
|
||||
{
|
||||
_page2.TextDeviceInfo.Text = "设备ID: (不包含)";
|
||||
}
|
||||
|
||||
if (_page1.CheckFanceId.IsChecked == true)
|
||||
{
|
||||
_page2.TextTelemetryInfo.Text = $"遥测ID: {_telemetryId}";
|
||||
_page2.TextTelemetryInfo.Visibility = Visibility.Visible;
|
||||
}
|
||||
else
|
||||
{
|
||||
_page2.TextTelemetryInfo.Text = "遥测ID: (不包含)";
|
||||
_page2.TextTelemetryInfo.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
if (_page1.CheckPPTLinkage.IsChecked == true || _page1.CheckInkRecognition.IsChecked == true)
|
||||
{
|
||||
_page2.CardConfiguration.Visibility = Visibility.Visible;
|
||||
_page2.TextConfigurationInfo.Text = "";
|
||||
if (_page1.CheckPPTLinkage.IsChecked == true)
|
||||
{
|
||||
_page2.TextConfigurationInfo.Text += $"PPT联动设置:\n{_pptLinkageSettings.TrimEnd('\n', '\r')}";
|
||||
}
|
||||
if (_page1.CheckInkRecognition.IsChecked == true)
|
||||
{
|
||||
if (_page1.CheckPPTLinkage.IsChecked == true) _page2.TextConfigurationInfo.Text += "\n";
|
||||
_page2.TextConfigurationInfo.Text += $"墨迹识别设置:\n{_inkRecognitionSettings.TrimEnd('\n', '\r')}";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_page2.CardConfiguration.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"更新第二页信息失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 生成Markdown格式的反馈信息模板,并填充到第三页的文本框中。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 生成的模板包含以下部分:
|
||||
/// - 环境信息(软件版本、操作系统、.NET版本、触控支持)
|
||||
/// - 设备信息(设备ID、遥测ID)
|
||||
/// - 软件配置(PPT联动设置、墨迹识别设置)
|
||||
/// </remarks>
|
||||
private void GenerateMarkdownTemplate()
|
||||
{
|
||||
string template = "## 环境信息\n";
|
||||
|
||||
if (_page1.CheckAppVersion.IsChecked == true)
|
||||
{
|
||||
template += $"- 软件版本: {_appVersion}\n";
|
||||
}
|
||||
if (_page1.CheckUpdateChannel.IsChecked == true)
|
||||
{
|
||||
template += $"- 更新通道: {_updateChannel}\n";
|
||||
}
|
||||
if (_page1.CheckOSVersion.IsChecked == true)
|
||||
{
|
||||
template += $"- 操作系统: {_osVersion}\n";
|
||||
}
|
||||
if (_page1.CheckNetVersion.IsChecked == true)
|
||||
{
|
||||
template += $"- .NET 版本: {_netVersion}\n";
|
||||
}
|
||||
if (_page1.CheckTouchSupport.IsChecked == true)
|
||||
{
|
||||
template += $"- 触控支持: {_touchSupport}\n";
|
||||
}
|
||||
|
||||
template += "\n## 设备信息\n";
|
||||
if (_page1.CheckDeviceId.IsChecked == true)
|
||||
{
|
||||
template += $"- 设备ID: {_deviceId}\n";
|
||||
}
|
||||
if (_page1.CheckFanceId.IsChecked == true && !string.IsNullOrEmpty(_telemetryId))
|
||||
{
|
||||
template += $"- 遥测ID: {_telemetryId}\n";
|
||||
}
|
||||
|
||||
if (_page1.CheckPPTLinkage.IsChecked == true || _page1.CheckInkRecognition.IsChecked == true)
|
||||
{
|
||||
template += "\n## 软件配置\n";
|
||||
if (_page1.CheckPPTLinkage.IsChecked == true)
|
||||
{
|
||||
template += "### PPT联动设置\n";
|
||||
template += _pptLinkageSettings.TrimEnd('\n', '\r');
|
||||
}
|
||||
if (_page1.CheckInkRecognition.IsChecked == true)
|
||||
{
|
||||
if (_page1.CheckPPTLinkage.IsChecked == true) template += "\n";
|
||||
template += "### 墨迹识别设置\n";
|
||||
template += _inkRecognitionSettings.TrimEnd('\n', '\r');
|
||||
}
|
||||
}
|
||||
|
||||
_page3.TextBoxMarkdownTemplate.Text = template;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建反馈信息元组,包含版本信息、系统信息和额外信息。
|
||||
/// </summary>
|
||||
/// <returns>包含版本信息、系统信息和额外信息的元组</returns>
|
||||
/// <remarks>
|
||||
/// 根据第一页用户的复选框选择情况,收集以下信息:
|
||||
/// - versionInfo: 软件版本和更新通道
|
||||
/// - systemInfo: 操作系统、.NET版本和触控支持
|
||||
/// - extraInfo: 设备ID、遥测ID、PPT联动设置和墨迹识别设置
|
||||
/// </remarks>
|
||||
private (string versionInfo, string systemInfo, string extraInfo) BuildFeedbackInfo()
|
||||
{
|
||||
string versionInfo = "";
|
||||
string systemInfo = "";
|
||||
string extraInfo = "";
|
||||
|
||||
if (_page1.CheckAppVersion.IsChecked == true || _page1.CheckUpdateChannel.IsChecked == true)
|
||||
{
|
||||
if (_page1.CheckAppVersion.IsChecked == true)
|
||||
{
|
||||
versionInfo += _appVersion;
|
||||
}
|
||||
if (_page1.CheckUpdateChannel.IsChecked == true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(versionInfo))
|
||||
{
|
||||
versionInfo += " ";
|
||||
}
|
||||
versionInfo += $"({_updateChannel})";
|
||||
}
|
||||
}
|
||||
|
||||
if (_page1.CheckOSVersion.IsChecked == true || _page1.CheckNetVersion.IsChecked == true || _page1.CheckTouchSupport.IsChecked == true)
|
||||
{
|
||||
if (_page1.CheckOSVersion.IsChecked == true)
|
||||
{
|
||||
systemInfo += _osVersion;
|
||||
}
|
||||
if (_page1.CheckNetVersion.IsChecked == true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(systemInfo))
|
||||
{
|
||||
systemInfo += " | ";
|
||||
}
|
||||
systemInfo += _netVersion;
|
||||
}
|
||||
if (_page1.CheckTouchSupport.IsChecked == true)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(systemInfo))
|
||||
{
|
||||
systemInfo += " | ";
|
||||
}
|
||||
systemInfo += $"触控:{_touchSupport}";
|
||||
}
|
||||
}
|
||||
|
||||
if (_page1.CheckDeviceId.IsChecked == true)
|
||||
{
|
||||
extraInfo += $"设备ID: {_deviceId}\n";
|
||||
}
|
||||
|
||||
if (_page1.CheckFanceId.IsChecked == true)
|
||||
{
|
||||
extraInfo += $"遥测ID: {_telemetryId}\n";
|
||||
}
|
||||
|
||||
if (_page1.CheckPPTLinkage.IsChecked == true)
|
||||
{
|
||||
extraInfo += "\nPPT联动设置:\n";
|
||||
extraInfo += _pptLinkageSettings.TrimEnd('\n', '\r');
|
||||
}
|
||||
|
||||
if (_page1.CheckInkRecognition.IsChecked == true)
|
||||
{
|
||||
extraInfo += "\n墨迹识别设置:\n";
|
||||
extraInfo += _inkRecognitionSettings.TrimEnd('\n', '\r');
|
||||
}
|
||||
|
||||
return (versionInfo, systemInfo, extraInfo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建GitHub Issue创建页面的URL,包含预填的环境信息参数。
|
||||
/// </summary>
|
||||
/// <returns>完整的GitHub Issue URL字符串</returns>
|
||||
/// <remarks>
|
||||
/// URL基于模板01-bug_report.yml,并根据用户选择的信息添加以下查询参数:
|
||||
/// - version: 版本信息
|
||||
/// - os: 系统信息
|
||||
/// - extra: 额外信息(设备ID、遥测ID、配置信息)
|
||||
/// </remarks>
|
||||
private string BuildGitHubIssueUrl()
|
||||
{
|
||||
var (versionInfo, systemInfo, extraInfo) = BuildFeedbackInfo();
|
||||
|
||||
string url = "https://github.com/InkCanvasForClass/community/issues/new?template=01-bug_report.yml";
|
||||
|
||||
if (!string.IsNullOrEmpty(versionInfo))
|
||||
{
|
||||
url += $"&version={Uri.EscapeDataString(versionInfo)}";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(systemInfo))
|
||||
{
|
||||
url += $"&os={Uri.EscapeDataString(systemInfo)}";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(extraInfo))
|
||||
{
|
||||
url += $"&extra={Uri.EscapeDataString(extraInfo)}";
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打开GitHub Issue页面按钮点击事件处理器。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 1. 构建包含环境信息的GitHub Issue URL
|
||||
/// 2. 使用系统默认浏览器打开该URL
|
||||
/// 3. 关闭反馈窗口
|
||||
/// </remarks>
|
||||
public void BtnOpenGitHubIssue_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string url = BuildGitHubIssueUrl();
|
||||
|
||||
Process.Start(new ProcessStartInfo
|
||||
{
|
||||
FileName = url,
|
||||
UseShellExecute = true
|
||||
});
|
||||
|
||||
Close();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"打开反馈链接失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 复制Issue链接按钮点击事件处理器,将GitHub Issue URL复制到剪贴板。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 1. 构建包含环境信息的GitHub Issue URL
|
||||
/// 2. 将URL复制到系统剪贴板
|
||||
/// 3. 更新按钮显示为"已复制 ✓"
|
||||
/// </remarks>
|
||||
public void CardCopyIssueUrl_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string url = BuildGitHubIssueUrl();
|
||||
|
||||
Clipboard.SetText(url);
|
||||
_page3.CardCopyIssueUrl.Header = "已复制 ✓";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"复制反馈链接失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 复制Markdown模板按钮点击事件处理器,将Markdown模板复制到剪贴板。
|
||||
/// </summary>
|
||||
/// <param name="sender">事件发送者</param>
|
||||
/// <param name="e">路由事件参数</param>
|
||||
/// <remarks>
|
||||
/// 1. 从第三页获取Markdown模板内容
|
||||
/// 2. 将模板复制到系统剪贴板
|
||||
/// 3. 更新按钮显示为"已复制 ✓"
|
||||
/// </remarks>
|
||||
public void BtnCopyMarkdown_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.SetText(_page3.MarkdownTemplate);
|
||||
_page3.BtnCopyMarkdown.Content = "已复制 ✓";
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"复制Markdown模板失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,6 +178,41 @@
|
||||
</Image>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<Border Height="1" Background="#ebebeb"/>
|
||||
<Grid Height="54">
|
||||
<TextBlock Foreground="#2e3436" FontSize="14.5" Text="反馈问题" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="18,0,0,0"/>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,18,0">
|
||||
<Button Name="BtnReportIssue" Content="提交反馈" Padding="12,6" Click="BtnReportIssue_Click" Cursor="Hand">
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Background" Value="#FF1d4ed8"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="FontSize" Value="13"/>
|
||||
<Setter Property="Cursor" Value="Hand"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#FF1e40af"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<StackPanel Orientation="Vertical" Margin="0,16,0,0">
|
||||
|
||||
@@ -460,6 +460,19 @@ namespace Ink_Canvas.Windows.SettingsViews
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnReportIssue_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
var feedbackWindow = new FeedbackWindow();
|
||||
feedbackWindow.ShowDialog();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"打开反馈窗口失败: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应用主题
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user