Add stuffs and new release
This commit is contained in:
parent
e03fd70a7a
commit
2c5cc042a0
@ -46,12 +46,12 @@ namespace Ink_Canvas
|
||||
|
||||
//Version 2.1.2-release
|
||||
TextBlockChangeLog.Text = "" +
|
||||
"1. 支持多页白板/黑板\n" +
|
||||
"2. 支持撤销\n" +
|
||||
"3. 双击清屏即可在清屏的同时隐藏画板\n" +
|
||||
"1. 支持模拟笔锋,字迹更美观\n" +
|
||||
"2. 支持自动查杀希沃部分软件\n" +
|
||||
"3. 检测到有隐藏幻灯片时可一键取消隐藏\n" +
|
||||
"4. 对深浅主题下墨迹颜色的优化\n" +
|
||||
"\n" +
|
||||
"目前基本可以取代“希沃白板”";
|
||||
"目前非联网功能可以完全取代“希沃白板 5”";
|
||||
TextBlockSuggestionTitle.Visibility = Visibility.Collapsed;
|
||||
//TextBlockSuggestion.Text = "老师讲评试卷可以点击右侧的背景和深色按钮,即可启动黑板功能(同样支持用笔来擦除),\n双指可以缩放和拖动,左边也会有工具栏方便画图形。";
|
||||
|
||||
|
@ -94,6 +94,9 @@
|
||||
<Compile Include="SettingsPage.xaml.cs">
|
||||
<DependentUpon>SettingsPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="WelcomeWindow.xaml.cs">
|
||||
<DependentUpon>WelcomeWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Page Include="ChangeLogWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@ -119,6 +122,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="WelcomeWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
|
@ -147,7 +147,13 @@
|
||||
FontSize="14"/>
|
||||
</StackPanel>
|
||||
<ui:ToggleSwitch Name="ToggleSwitchShowCursor" Header="显示画笔光标" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchShowCursor_Toggled"/>
|
||||
<ui:ToggleSwitch Name="ToggleSwitchSimulatePressure" Header="模拟压感(笔锋)(Beta)" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchSimulatePressure_Toggled"/>
|
||||
<ui:ToggleSwitch Name="ToggleSwitchSimulatePressure" Visibility="Collapsed" Header="模拟压感(笔锋)(Beta)" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchSimulatePressure_Toggled"/>
|
||||
<TextBlock Text="画笔样式" FontFamily="Microsoft YaHei UI" FontSize="14"/>
|
||||
<ComboBox Name="ComboBoxPenStyle" FontFamily="Microsoft YaHei UI" SelectedIndex="0" SelectionChanged="ComboBoxPenStyle_SelectionChanged">
|
||||
<ComboBoxItem Content="模拟笔锋(仿希沃算法)" FontFamily="Microsoft YaHei UI"/>
|
||||
<ComboBoxItem Content="模拟笔锋(根据速度计算)" FontFamily="Microsoft YaHei UI"/>
|
||||
<ComboBoxItem Content="无笔锋" FontFamily="Microsoft YaHei UI"/>
|
||||
</ComboBox>
|
||||
</ui:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="手势">
|
||||
@ -193,6 +199,12 @@
|
||||
</StackPanel>
|
||||
</ui:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="自动">
|
||||
<ui:SimpleStackPanel Spacing="12">
|
||||
<ui:ToggleSwitch Name="ToggleSwitchAutoKillPptService" Header="自动查杀“PPT 小工具”" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoKillPptService_Toggled"/>
|
||||
<ui:ToggleSwitch Name="ToggleSwitchAutoKillEasiNote" Header="自动查杀“希沃白板 5”" IsOn="False" FontFamily="Microsoft YaHei UI" OnContent="开" OffContent="关" Toggled="ToggleSwitchAutoKillEasiNote_Toggled"/>
|
||||
</ui:SimpleStackPanel>
|
||||
</GroupBox>
|
||||
<GroupBox Header="关于">
|
||||
<ui:SimpleStackPanel Spacing="12">
|
||||
<ui:SimpleStackPanel Orientation="Horizontal" Spacing="4">
|
||||
@ -297,21 +309,46 @@
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
|
||||
Click="BtnSwitch_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
|
||||
<StackPanel Name="StackPanelColors" Margin="7,0,7,0">
|
||||
<Button Name="BtnColorBlack" Content="" FontFamily="Microsoft YaHei UI" Background="Black"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorBlack_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
|
||||
<Button Name="BtnColorRed" Content="" FontFamily="Microsoft YaHei UI" Background="Red"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorRed_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
|
||||
<Button Name="BtnColorGreen" Content="" FontFamily="Microsoft YaHei UI" Background="#169141"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorGreen_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
|
||||
<Button Name="BtnColorBlue" Content="" FontFamily="Microsoft YaHei UI" Background="#239AD6"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorBlue_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
|
||||
<Button Name="BtnColorYellow" Content="" FontFamily="Microsoft YaHei UI" Background="#F38B00"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorYellow_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}"/>
|
||||
<Button Name="BtnColorBlack" FontFamily="Microsoft YaHei UI" Background="Black"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorBlack_Click">
|
||||
<Viewbox Name="ViewboxBtnColorBlackContent" Visibility="Collapsed">
|
||||
<ui:SymbolIcon Symbol="Accept" Name="SymbolIconBtnColorBlackContent" Foreground="White"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Name="BtnColorRed" FontFamily="Microsoft YaHei UI" Background="Red"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorRed_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
|
||||
<Viewbox Name="ViewboxBtnColorRedContent">
|
||||
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Name="BtnColorGreen" FontFamily="Microsoft YaHei UI" Background="#169141"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorGreen_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
|
||||
<Viewbox Name="ViewboxBtnColorGreenContent" Visibility="Collapsed">
|
||||
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Name="BtnColorBlue" FontFamily="Microsoft YaHei UI" Background="#239AD6"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorBlue_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
|
||||
<Viewbox Name="ViewboxBtnColorBlueContent" Visibility="Collapsed">
|
||||
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
<Button Name="BtnColorYellow" FontFamily="Microsoft YaHei UI" Background="#F38B00"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Height="{Binding ElementName=StackPanelColors, Path=ActualWidth}"
|
||||
Click="BtnColorYellow_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}">
|
||||
<Viewbox Name="ViewboxBtnColorYellowContent" Visibility="Collapsed">
|
||||
<ui:SymbolIcon Symbol="Accept" Foreground="{Binding ElementName=SymbolIconBtnColorBlackContent, Path=Foreground}"/>
|
||||
</Viewbox>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<Button Name="BtnClear" Content="清屏" FontFamily="Microsoft YaHei UI"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
|
||||
@ -402,9 +439,11 @@
|
||||
<Button Name="BtnSelect" Content="选择
墨迹" Visibility="Visible" FontFamily="Microsoft YaHei UI"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
|
||||
Click="BtnSelect_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
|
||||
<Button Name="BtnPen" Content="笔" Visibility="Visible" FontFamily="Microsoft YaHei UI"
|
||||
<Button Name="BtnPen" Visibility="Visible" FontFamily="Microsoft YaHei UI"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
|
||||
Click="BtnPen_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
|
||||
Click="BtnPen_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}">
|
||||
<ui:SymbolIcon Symbol="Edit"/>
|
||||
</Button>
|
||||
<Button Name="BtnErase" Content="橡皮" Visibility="Visible" FontFamily="Microsoft YaHei UI"
|
||||
Margin="0,10,0,0" Width="{Binding ElementName=StackPanelMain, Path=ActualWidth}"
|
||||
Click="BtnErase_Click" Foreground="{Binding ElementName=BtnExit, Path=Foreground}" Background="{Binding ElementName=BtnExit, Path=Background}"/>
|
||||
|
@ -43,11 +43,18 @@ namespace Ink_Canvas
|
||||
{
|
||||
InitializeComponent();
|
||||
BorderSettings.Visibility = Visibility.Collapsed;
|
||||
|
||||
timerCheckPPT.Elapsed += TimerCheckPPT_Elapsed;
|
||||
timerCheckPPT.Interval = 1000;
|
||||
|
||||
timerKillProcess.Elapsed += TimerKillProcess_Elapsed;
|
||||
timerKillProcess.Interval = 5000;
|
||||
}
|
||||
|
||||
Timer timerCheckPPT = new Timer();
|
||||
Timer timerKillProcess = new Timer();
|
||||
|
||||
Settings Settings = new Settings();
|
||||
public static Settings Settings = new Settings();
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
@ -145,51 +152,61 @@ namespace Ink_Canvas
|
||||
TextBlockVersion.Text = version.ToString();
|
||||
|
||||
string lastVersion = "";
|
||||
try
|
||||
if (!File.Exists(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "versions.ini"))
|
||||
{
|
||||
lastVersion = File.ReadAllText(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "versions.ini");
|
||||
new WelcomeWindow().ShowDialog();
|
||||
}
|
||||
catch { }
|
||||
if (!lastVersion.Contains(version.ToString()))
|
||||
else
|
||||
{
|
||||
new ChangeLogWindow().ShowDialog();
|
||||
lastVersion += "\n" + version.ToString();
|
||||
File.WriteAllText("versions.ini", lastVersion.Trim());
|
||||
}
|
||||
});
|
||||
|
||||
try
|
||||
{
|
||||
if (response.Contains("<update>"))
|
||||
{
|
||||
string str = Strings.Mid(response, response.IndexOf("<update>") + 9);
|
||||
if (str.Contains("<update>"))
|
||||
try
|
||||
{
|
||||
str = Strings.Left(str, str.IndexOf("<update>")).Trim();
|
||||
if (str.Length > 0)
|
||||
lastVersion = File.ReadAllText(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "versions.ini");
|
||||
}
|
||||
catch { }
|
||||
if (!lastVersion.Contains(version.ToString()))
|
||||
{
|
||||
new ChangeLogWindow().ShowDialog();
|
||||
lastVersion += "\n" + version.ToString();
|
||||
File.WriteAllText("versions.ini", lastVersion.Trim());
|
||||
}
|
||||
|
||||
//第二次启动时才可以进入检查版本更新模式
|
||||
new Thread(new ThreadStart(() => {
|
||||
try
|
||||
{
|
||||
string updateIP;
|
||||
int updatePort;
|
||||
|
||||
string[] vs = str.Split(':');
|
||||
updateIP = vs[0];
|
||||
updatePort = int.Parse(vs[1]);
|
||||
|
||||
if (OAUS.Core.VersionHelper.HasNewVersion(GetIp(updateIP), updatePort))
|
||||
if (response.Contains("<update>"))
|
||||
{
|
||||
string updateExePath = AppDomain.CurrentDomain.BaseDirectory + "AutoUpdater\\AutoUpdater.exe";
|
||||
System.Diagnostics.Process myProcess = System.Diagnostics.Process.Start(updateExePath);
|
||||
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
string str = Strings.Mid(response, response.IndexOf("<update>") + 9);
|
||||
if (str.Contains("<update>"))
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
});
|
||||
str = Strings.Left(str, str.IndexOf("<update>")).Trim();
|
||||
if (str.Length > 0)
|
||||
{
|
||||
string updateIP;
|
||||
int updatePort;
|
||||
|
||||
string[] vs = str.Split(':');
|
||||
updateIP = vs[0];
|
||||
updatePort = int.Parse(vs[1]);
|
||||
|
||||
if (OAUS.Core.VersionHelper.HasNewVersion(GetIp(updateIP), updatePort))
|
||||
{
|
||||
string updateExePath = AppDomain.CurrentDomain.BaseDirectory + "AutoUpdater\\AutoUpdater.exe";
|
||||
System.Diagnostics.Process myProcess = System.Diagnostics.Process.Start(updateExePath);
|
||||
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
Application.Current.Shutdown();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
})).Start();
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
});
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@ -311,8 +328,7 @@ namespace Ink_Canvas
|
||||
|
||||
if (Settings.Behavior.PowerPointSupport)
|
||||
{
|
||||
timerCheckPPT.Elapsed += TimerCheckPPT_Elapsed;
|
||||
timerCheckPPT.Interval = 1000;
|
||||
ToggleSwitchSupportPowerPoint.IsOn = true;
|
||||
timerCheckPPT.Start();
|
||||
}
|
||||
else
|
||||
@ -372,14 +388,90 @@ namespace Ink_Canvas
|
||||
ToggleSwitchShowCursor.IsOn = false;
|
||||
inkCanvas.ForceCursor = false;
|
||||
}
|
||||
|
||||
if (Settings.Canvas.InkStyle != 0)
|
||||
{
|
||||
ComboBoxPenStyle.SelectedIndex = Settings.Canvas.InkStyle;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.Canvas = new Canvas();
|
||||
}
|
||||
|
||||
if (Settings.Automation != null)
|
||||
{
|
||||
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService)
|
||||
{
|
||||
timerKillProcess.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
timerKillProcess.Stop();
|
||||
}
|
||||
|
||||
if (Settings.Automation.IsAutoKillEasiNote)
|
||||
{
|
||||
ToggleSwitchAutoKillEasiNote.IsOn = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ToggleSwitchAutoKillEasiNote.IsOn = false;
|
||||
}
|
||||
|
||||
if (Settings.Automation.IsAutoKillPptService)
|
||||
{
|
||||
ToggleSwitchAutoKillPptService.IsOn = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ToggleSwitchAutoKillPptService.IsOn = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Settings.Automation = new Automation();
|
||||
}
|
||||
}
|
||||
|
||||
string settingsFileName = "settings.json";
|
||||
private void TimerKillProcess_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string arg = "/F";
|
||||
if (Settings.Automation.IsAutoKillPptService)
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName("PPTService");
|
||||
if (processes.Length > 0)
|
||||
{
|
||||
arg += " /IM PPTService.exe";
|
||||
}
|
||||
}
|
||||
if (Settings.Automation.IsAutoKillEasiNote)
|
||||
{
|
||||
Process[] processes = Process.GetProcessesByName("EasiNote");
|
||||
if (processes.Length > 0)
|
||||
{
|
||||
arg += " /IM EasiNote.exe";
|
||||
}
|
||||
}
|
||||
if (arg != "/F")
|
||||
{
|
||||
Process p = new Process();
|
||||
p.StartInfo = new ProcessStartInfo("taskkill", arg);
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
p.Start();
|
||||
|
||||
if (arg.Contains("EasiNote"))
|
||||
{
|
||||
MessageBox.Show("检测到“希沃白板 5”,已自动关闭。");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public static string settingsFileName = "settings.json";
|
||||
bool isLoaded = false;
|
||||
|
||||
private void back_HotKey(object sender, ExecutedRoutedEventArgs e)
|
||||
@ -454,6 +546,7 @@ namespace Ink_Canvas
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.EraseByStroke;
|
||||
drawingShapeMode = 0;
|
||||
inkCanvas_EditingModeChanged(inkCanvas, null);
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
|
||||
private void BtnClear_Click(object sender, RoutedEventArgs e)
|
||||
@ -477,6 +570,16 @@ namespace Ink_Canvas
|
||||
}
|
||||
|
||||
inkCanvas.Strokes.Clear();
|
||||
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
|
||||
private void CancelSingleFingerDragMode()
|
||||
{
|
||||
if (isSingleFingerDragMode)
|
||||
{
|
||||
BtnFingerDragMode_Click(BtnFingerDragMode, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnHideControl_Click(object sender, RoutedEventArgs e)
|
||||
@ -509,6 +612,32 @@ namespace Ink_Canvas
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
drawingShapeMode = 0;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
CancelSingleFingerDragMode();
|
||||
|
||||
// 改变选中提示
|
||||
ViewboxBtnColorBlackContent.Visibility = Visibility.Collapsed;
|
||||
ViewboxBtnColorBlueContent.Visibility = Visibility.Collapsed;
|
||||
ViewboxBtnColorGreenContent.Visibility = Visibility.Collapsed;
|
||||
ViewboxBtnColorRedContent.Visibility = Visibility.Collapsed;
|
||||
ViewboxBtnColorRedContent.Visibility = Visibility.Collapsed;
|
||||
switch (inkColor)
|
||||
{
|
||||
case 0:
|
||||
ViewboxBtnColorBlackContent.Visibility = Visibility.Visible;
|
||||
break;
|
||||
case 1:
|
||||
ViewboxBtnColorRedContent.Visibility = Visibility.Visible;
|
||||
break;
|
||||
case 2:
|
||||
ViewboxBtnColorGreenContent.Visibility = Visibility.Visible;
|
||||
break;
|
||||
case 3:
|
||||
ViewboxBtnColorBlueContent.Visibility = Visibility.Visible;
|
||||
break;
|
||||
case 4:
|
||||
ViewboxBtnColorYellowContent.Visibility = Visibility.Visible;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void BtnColorBlack_Click(object sender, RoutedEventArgs e)
|
||||
@ -860,6 +989,7 @@ namespace Ink_Canvas
|
||||
BtnColorBlack.Background = Brushes.White;
|
||||
BtnColorGreen.Background = new SolidColorBrush(StringToColor("#FF1ED760"));
|
||||
BtnColorYellow.Background = new SolidColorBrush(StringToColor("#FFFFC000"));
|
||||
SymbolIconBtnColorBlackContent.Foreground = Brushes.Black;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
|
||||
if (inkColor == 0)
|
||||
{
|
||||
@ -886,6 +1016,7 @@ namespace Ink_Canvas
|
||||
BtnColorBlack.Background = Brushes.Black;
|
||||
BtnColorGreen.Background = new SolidColorBrush(StringToColor("#FF169141"));
|
||||
BtnColorYellow.Background = new SolidColorBrush(StringToColor("#FFF38B00"));
|
||||
SymbolIconBtnColorBlackContent.Foreground = Brushes.White;
|
||||
ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
|
||||
if (inkColor == 0)
|
||||
{
|
||||
@ -1404,6 +1535,15 @@ namespace Ink_Canvas
|
||||
|
||||
Settings.Behavior.PowerPointSupport = ToggleSwitchSupportPowerPoint.IsOn;
|
||||
SaveSettingsToFile();
|
||||
|
||||
if (Settings.Behavior.PowerPointSupport)
|
||||
{
|
||||
timerCheckPPT.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
timerCheckPPT.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchShowCanvasAtNewSlideShow_Toggled(object sender, RoutedEventArgs e)
|
||||
@ -1523,10 +1663,53 @@ namespace Ink_Canvas
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchTransparentButtonBackground_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Appearance.IsTransparentButtonBackground = ToggleSwitchTransparentButtonBackground.IsOn;
|
||||
if (Settings.Appearance.IsTransparentButtonBackground)
|
||||
{
|
||||
BtnExit.Background = new SolidColorBrush(StringToColor("#7F909090"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BtnSwitchTheme.Content.ToString() == "深色")
|
||||
{
|
||||
//Light
|
||||
BtnExit.Background = new SolidColorBrush(StringToColor("#FFCCCCCC"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//Dark
|
||||
BtnExit.Background = new SolidColorBrush(StringToColor("#FF555555"));
|
||||
}
|
||||
}
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchShowCursor_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Canvas.IsShowCursor = ToggleSwitchShowCursor.IsOn;
|
||||
inkCanvas_EditingModeChanged(inkCanvas, null);
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Canvas
|
||||
|
||||
private void ComboBoxPenStyle_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Canvas.InkStyle = ComboBoxPenStyle.SelectedIndex;
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void InkWidthSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
@ -1541,7 +1724,127 @@ namespace Ink_Canvas
|
||||
|
||||
#endregion
|
||||
|
||||
private void SaveSettingsToFile()
|
||||
#region Automation
|
||||
|
||||
private void ToggleSwitchAutoKillPptService_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Automation.IsAutoKillPptService = ToggleSwitchAutoKillPptService.IsOn;
|
||||
SaveSettingsToFile();
|
||||
|
||||
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService)
|
||||
{
|
||||
timerKillProcess.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
timerKillProcess.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private void ToggleSwitchAutoKillEasiNote_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
Settings.Automation.IsAutoKillEasiNote = ToggleSwitchAutoKillEasiNote.IsOn;
|
||||
SaveSettingsToFile();
|
||||
|
||||
if (Settings.Automation.IsAutoKillEasiNote || Settings.Automation.IsAutoKillPptService)
|
||||
{
|
||||
timerKillProcess.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
timerKillProcess.Stop();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Gesture
|
||||
|
||||
private void ToggleSwitchEnableTwoFingerRotation_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Gesture.IsEnableTwoFingerRotation = ToggleSwitchEnableTwoFingerRotation.IsOn;
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Gesture.IsEnableTwoFingerGestureInPresentationMode = ToggleSwitchEnableTwoFingerGestureInPresentationMode.IsOn;
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Reset
|
||||
|
||||
public static void SetSettingsToRecommendation()
|
||||
{
|
||||
bool IsAutoKillPptService = Settings.Automation.IsAutoKillPptService;
|
||||
bool IsAutoKillEasiNote = Settings.Automation.IsAutoKillEasiNote;
|
||||
Settings = new Settings();
|
||||
Settings.Appearance.IsShowEraserButton = false;
|
||||
Settings.Appearance.IsShowExitButton = false;
|
||||
Settings.Startup.IsAutoHideCanvas = true;
|
||||
Settings.Automation.IsAutoKillEasiNote = IsAutoKillEasiNote;
|
||||
Settings.Automation.IsAutoKillPptService = IsAutoKillPptService;
|
||||
Settings.Canvas.InkWidth = 2.5;
|
||||
}
|
||||
|
||||
private void BtnResetToSuggestion_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
isLoaded = false;
|
||||
SetSettingsToRecommendation();
|
||||
SaveSettingsToFile();
|
||||
LoadSettings(false);
|
||||
isLoaded = true;
|
||||
|
||||
if (ToggleSwitchRunAtStartup.IsOn == false)
|
||||
{
|
||||
ToggleSwitchRunAtStartup.IsOn = true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
SymbolIconResetSuggestionComplete.Visibility = Visibility.Visible;
|
||||
new Thread(new ThreadStart(() => {
|
||||
Thread.Sleep(5000);
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
SymbolIconResetSuggestionComplete.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
})).Start();
|
||||
}
|
||||
|
||||
private void BtnResetToDefault_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
isLoaded = false;
|
||||
File.Delete("settings.json");
|
||||
Settings = new Settings();
|
||||
LoadSettings(false);
|
||||
isLoaded = true;
|
||||
}
|
||||
catch { }
|
||||
SymbolIconResetDefaultComplete.Visibility = Visibility.Visible;
|
||||
new Thread(new ThreadStart(() => {
|
||||
Thread.Sleep(5000);
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
SymbolIconResetDefaultComplete.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
})).Start();
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static void SaveSettingsToFile()
|
||||
{
|
||||
string text = JsonConvert.SerializeObject(Settings, Formatting.Indented);
|
||||
try
|
||||
@ -1601,7 +1904,7 @@ namespace Ink_Canvas
|
||||
/// </summary>
|
||||
/// <param name="exeName">程序名称</param>
|
||||
/// <returns></returns>
|
||||
public bool StartAutomaticallyCreate(string exeName)
|
||||
public static bool StartAutomaticallyCreate(string exeName)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1629,7 +1932,7 @@ namespace Ink_Canvas
|
||||
/// </summary>
|
||||
/// <param name="exeName">程序名称</param>
|
||||
/// <returns></returns>
|
||||
public bool StartAutomaticallyDel(string exeName)
|
||||
public static bool StartAutomaticallyDel(string exeName)
|
||||
{
|
||||
try
|
||||
{
|
||||
@ -1668,42 +1971,6 @@ namespace Ink_Canvas
|
||||
return ipEndPoint.Address.ToString();
|
||||
}
|
||||
|
||||
private void ToggleSwitchTransparentButtonBackground_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Appearance.IsTransparentButtonBackground = ToggleSwitchTransparentButtonBackground.IsOn;
|
||||
if (Settings.Appearance.IsTransparentButtonBackground)
|
||||
{
|
||||
BtnExit.Background = new SolidColorBrush(StringToColor("#7F909090"));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BtnSwitchTheme.Content.ToString() == "深色")
|
||||
{
|
||||
//Light
|
||||
BtnExit.Background = new SolidColorBrush(StringToColor("#FFCCCCCC"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//Dark
|
||||
BtnExit.Background = new SolidColorBrush(StringToColor("#FF555555"));
|
||||
}
|
||||
}
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchShowCursor_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Canvas.IsShowCursor = ToggleSwitchShowCursor.IsOn;
|
||||
inkCanvas_EditingModeChanged(inkCanvas, null);
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void inkCanvas_EditingModeChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (Settings.Canvas.IsShowCursor)
|
||||
@ -1733,6 +2000,7 @@ namespace Ink_Canvas
|
||||
drawingShapeMode = 0;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.Ink;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
|
||||
private void BtnDrawLine_Click(object sender, RoutedEventArgs e)
|
||||
@ -1741,6 +2009,7 @@ namespace Ink_Canvas
|
||||
drawingShapeMode = 1;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
|
||||
private void BtnDrawArrow_Click(object sender, RoutedEventArgs e)
|
||||
@ -1749,6 +2018,7 @@ namespace Ink_Canvas
|
||||
drawingShapeMode = 2;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
|
||||
private void BtnDrawRectangle_Click(object sender, RoutedEventArgs e)
|
||||
@ -1757,6 +2027,7 @@ namespace Ink_Canvas
|
||||
drawingShapeMode = 3;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
|
||||
private void BtnDrawEllipse_Click(object sender, RoutedEventArgs e)
|
||||
@ -1765,6 +2036,7 @@ namespace Ink_Canvas
|
||||
drawingShapeMode = 4;
|
||||
inkCanvas.EditingMode = InkCanvasEditingMode.None;
|
||||
inkCanvas.IsManipulationEnabled = true;
|
||||
CancelSingleFingerDragMode();
|
||||
}
|
||||
|
||||
private void inkCanvas_TouchMove(object sender, TouchEventArgs e)
|
||||
@ -2101,74 +2373,6 @@ namespace Ink_Canvas
|
||||
|
||||
#endregion Left Side Panel
|
||||
|
||||
private void ToggleSwitchEnableTwoFingerRotation_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Gesture.IsEnableTwoFingerRotation = ToggleSwitchEnableTwoFingerRotation.IsOn;
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void ToggleSwitchEnableTwoFingerGestureInPresentationMode_Toggled(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!isLoaded) return;
|
||||
|
||||
Settings.Gesture.IsEnableTwoFingerGestureInPresentationMode = ToggleSwitchEnableTwoFingerGestureInPresentationMode.IsOn;
|
||||
|
||||
SaveSettingsToFile();
|
||||
}
|
||||
|
||||
private void BtnResetToSuggestion_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
isLoaded = false;
|
||||
Settings = new Settings();
|
||||
Settings.Appearance.IsShowEraserButton = false;
|
||||
Settings.Appearance.IsShowExitButton = false;
|
||||
Settings.Startup.IsAutoHideCanvas = true;
|
||||
SaveSettingsToFile();
|
||||
LoadSettings(false);
|
||||
isLoaded = true;
|
||||
|
||||
if (ToggleSwitchRunAtStartup.IsOn == false)
|
||||
{
|
||||
ToggleSwitchRunAtStartup.IsOn = true;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
SymbolIconResetSuggestionComplete.Visibility = Visibility.Visible;
|
||||
new Thread(new ThreadStart(() => {
|
||||
Thread.Sleep(5000);
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
SymbolIconResetSuggestionComplete.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
})).Start();
|
||||
}
|
||||
|
||||
private void BtnResetToDefault_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
isLoaded = false;
|
||||
File.Delete("settings.json");
|
||||
Settings = new Settings();
|
||||
LoadSettings(false);
|
||||
isLoaded = true;
|
||||
}
|
||||
catch { }
|
||||
SymbolIconResetDefaultComplete.Visibility = Visibility.Visible;
|
||||
new Thread(new ThreadStart(() => {
|
||||
Thread.Sleep(5000);
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
SymbolIconResetDefaultComplete.Visibility = Visibility.Collapsed;
|
||||
});
|
||||
})).Start();
|
||||
}
|
||||
|
||||
|
||||
#region Whiteboard Controls
|
||||
|
||||
@ -2333,13 +2537,18 @@ namespace Ink_Canvas
|
||||
//此函数中的所有代码版权所有 WXRIW,在其他项目中使用前必须提前联系(wxriw@outlook.com),谢谢!
|
||||
private void inkCanvas_StrokeCollected(object sender, InkCanvasStrokeCollectedEventArgs e)
|
||||
{
|
||||
//Label.Visibility = Visibility.Visible;
|
||||
//Label.Content = e.Stroke.StylusPoints.Count.ToString();
|
||||
//if (!ToggleSwitchSimulatePressure.IsOn) return;
|
||||
int mode = 1;
|
||||
switch (mode)
|
||||
// 检查是否是压感笔书写
|
||||
foreach (StylusPoint stylusPoint in e.Stroke.StylusPoints)
|
||||
{
|
||||
case 0:
|
||||
if (stylusPoint.PressureFactor!= 0.5 && stylusPoint.PressureFactor != 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
switch (Settings.Canvas.InkStyle)
|
||||
{
|
||||
case 1:
|
||||
try
|
||||
{
|
||||
StylusPointCollection stylusPoints = new StylusPointCollection();
|
||||
@ -2376,13 +2585,13 @@ namespace Ink_Canvas
|
||||
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case 0:
|
||||
try
|
||||
{
|
||||
StylusPointCollection stylusPoints = new StylusPointCollection();
|
||||
int n = e.Stroke.StylusPoints.Count - 1;
|
||||
double pressure = 0.1;
|
||||
int x = 8;
|
||||
int x = 10;
|
||||
if(n >= x)
|
||||
{
|
||||
for (int i = 0; i < n - x; i++)
|
||||
@ -2423,7 +2632,7 @@ namespace Ink_Canvas
|
||||
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case 3: //根据 mode == 0 改写,目前暂未完成
|
||||
try
|
||||
{
|
||||
StylusPointCollection stylusPoints = new StylusPointCollection();
|
||||
|
@ -51,5 +51,5 @@ using System.Windows;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.2.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.2.0.0")]
|
||||
[assembly: AssemblyVersion("2.2.1.0")]
|
||||
[assembly: AssemblyFileVersion("2.2.1.0")]
|
||||
|
@ -9,6 +9,10 @@ namespace Ink_Canvas
|
||||
{
|
||||
public class Settings
|
||||
{
|
||||
[JsonProperty("appearance")]
|
||||
public Appearance Appearance { get; set; } = new Appearance();
|
||||
[JsonProperty("automation")]
|
||||
public Automation Automation { get; set; } = new Automation();
|
||||
[JsonProperty("behavior")]
|
||||
public Behavior Behavior { get; set; } = new Behavior();
|
||||
[JsonProperty("canvas")]
|
||||
@ -17,8 +21,6 @@ namespace Ink_Canvas
|
||||
public Gesture Gesture { get; set; } = new Gesture();
|
||||
[JsonProperty("startup")]
|
||||
public Startup Startup { get; set; } = new Startup();
|
||||
[JsonProperty("appearance")]
|
||||
public Appearance Appearance { get; set; } = new Appearance();
|
||||
}
|
||||
|
||||
public class Behavior
|
||||
@ -35,6 +37,8 @@ namespace Ink_Canvas
|
||||
public double InkWidth { get; set; } = 2.5;
|
||||
[JsonProperty("isShowCursor")]
|
||||
public bool IsShowCursor { get; set; } = false;
|
||||
[JsonProperty("inkStyle")]
|
||||
public int InkStyle { get; set; } = 0;
|
||||
}
|
||||
|
||||
public class Gesture
|
||||
@ -68,4 +72,12 @@ namespace Ink_Canvas
|
||||
[JsonProperty("isShowModeFingerToggleSwitch")]
|
||||
public bool IsShowModeFingerToggleSwitch { get; set; } = true;
|
||||
}
|
||||
|
||||
public class Automation
|
||||
{
|
||||
[JsonProperty("isAutoKillPptService")]
|
||||
public bool IsAutoKillPptService { get; set; } = false;
|
||||
[JsonProperty("isAutoKillEasiNote")]
|
||||
public bool IsAutoKillEasiNote { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
27
Ink Canvas/WelcomeWindow.xaml
Normal file
27
Ink Canvas/WelcomeWindow.xaml
Normal file
@ -0,0 +1,27 @@
|
||||
<Window x:Class="Ink_Canvas.WelcomeWindow"
|
||||
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.modernwpf.com/2019"
|
||||
mc:Ignorable="d" Topmost="True" ResizeMode="NoResize" ui:WindowHelper.UseModernWindowStyle="True"
|
||||
WindowStartupLocation="CenterScreen" FontFamily="Microsoft YaHei UI" Closing="Window_Closing"
|
||||
Title="欢迎向导 - Ink Canvas 画板" Height="250" Width="400">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="40"/>
|
||||
<RowDefinition/>
|
||||
<RowDefinition Height="40"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="欢迎在马鞍山二中使用 Ink Canvas 画板" FontSize="20" Margin="10,10,0,0"/>
|
||||
<Image Source="Logo.png" Grid.Row="1" HorizontalAlignment="Right" Margin="20"/>
|
||||
<ui:SimpleStackPanel Grid.Row="1" Margin="30,10,0,0">
|
||||
<CheckBox Name="CheckBoxSetAsRecommendation" FontFamily="Microsoft YaHei UI" Content="配置为推荐设置" IsChecked="True"/>
|
||||
<CheckBox Name="CheckBoxRunAtStartup" FontFamily="Microsoft YaHei UI" Content="开机时运行" IsChecked="True"/>
|
||||
<CheckBox Name="CheckBoxAutoKillPptService" FontFamily="Microsoft YaHei UI" Content="自动查杀“PPT 小工具”" IsChecked="True"/>
|
||||
<CheckBox Name="CheckBoxAutoKillEasiNote" FontFamily="Microsoft YaHei UI" Content="自动查杀“希沃白板 5”"/>
|
||||
</ui:SimpleStackPanel>
|
||||
<Button Grid.Row="2" Margin="0,0,10,10" FontFamily="Microsoft YaHei UI"
|
||||
HorizontalAlignment="Right" Content="确定" Width="100" Click="Button_Click"/>
|
||||
</Grid>
|
||||
</Window>
|
65
Ink Canvas/WelcomeWindow.xaml.cs
Normal file
65
Ink Canvas/WelcomeWindow.xaml.cs
Normal file
@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Ink_Canvas
|
||||
{
|
||||
/// <summary>
|
||||
/// WelcomeWindow.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class WelcomeWindow : Window
|
||||
{
|
||||
public WelcomeWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
MainWindow.SaveSettingsToFile();
|
||||
|
||||
File.WriteAllText("versions.ini", Assembly.GetExecutingAssembly().GetName().Version.ToString());
|
||||
Process.Start(System.Windows.Forms.Application.ExecutablePath);
|
||||
Application.Current.Shutdown();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user