2023-02-12 22:50:17 +08:00
|
|
|
|
using System.Diagnostics;
|
2021-10-14 01:22:37 +08:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
namespace Ink_Canvas
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// WelcomeWindow.xaml 的交互逻辑
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class WelcomeWindow : Window
|
|
|
|
|
{
|
|
|
|
|
public WelcomeWindow()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-07 10:28:15 +08:00
|
|
|
|
public static bool IsNewBuilding = false;
|
|
|
|
|
|
2021-10-14 01:22:37 +08:00
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (CheckBoxSetAsRecommendation.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
// 完成向导后先保存版本至 versions.ini,再强行重启,以读取设置
|
|
|
|
|
MainWindow.SetSettingsToRecommendation();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CheckBoxRunAtStartup.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
MainWindow.StartAutomaticallyCreate("InkCanvas");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CheckBoxAutoKillPptService.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
MainWindow.Settings.Automation.IsAutoKillPptService = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CheckBoxAutoKillEasiNote.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
MainWindow.Settings.Automation.IsAutoKillEasiNote = true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-07 10:28:15 +08:00
|
|
|
|
if (CheckBoxNewBuildingOptimization.IsChecked == true)
|
|
|
|
|
{
|
|
|
|
|
MainWindow.Settings.Appearance.IsShowEraserButton = true;
|
|
|
|
|
MainWindow.Settings.Startup.IsAutoEnterModeFinger = true;
|
|
|
|
|
}
|
|
|
|
|
|
2021-10-14 01:22:37 +08:00
|
|
|
|
MainWindow.SaveSettingsToFile();
|
|
|
|
|
|
2022-09-07 10:28:15 +08:00
|
|
|
|
string str = string.Empty;
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
str = File.ReadAllText(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Versions.ini");
|
|
|
|
|
}
|
|
|
|
|
catch { }
|
|
|
|
|
|
2022-09-07 14:14:21 +08:00
|
|
|
|
str = (str + "\n" + Assembly.GetExecutingAssembly().GetName().Version.ToString() + "\n" + "NewWelcomeConfigured").Trim();
|
2022-09-07 10:28:15 +08:00
|
|
|
|
File.WriteAllText("versions.ini", str);
|
2021-10-14 01:22:37 +08:00
|
|
|
|
Process.Start(System.Windows.Forms.Application.ExecutablePath);
|
2022-08-31 17:22:46 +08:00
|
|
|
|
|
|
|
|
|
MainWindow.CloseIsFromButton = true;
|
2021-10-14 01:22:37 +08:00
|
|
|
|
Application.Current.Shutdown();
|
|
|
|
|
}
|
2022-09-07 10:28:15 +08:00
|
|
|
|
|
|
|
|
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (IsNewBuilding)
|
|
|
|
|
{
|
|
|
|
|
CheckBoxNewBuildingOptimization.IsChecked = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-10-14 01:22:37 +08:00
|
|
|
|
}
|
|
|
|
|
}
|