Skip to content

Commit

Permalink
Fix something
Browse files Browse the repository at this point in the history
  • Loading branch information
WXRIW committed Sep 7, 2022
1 parent 9fd4fcb commit ab87abf
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Ink Canvas/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@
</Viewbox>
</Border>
</ui:SimpleStackPanel>
<Grid Width="20" Height="24" Margin="0,1.5,-2,0" MouseDown="Border_MouseDown" MouseUp="ImageEraser_MouseUp" Visibility="{Binding ElementName=BtnErase, Path=Visibility}">
<Image Margin="-1,-4,-1,-2" Source="{DynamicResource ImageSource.RubberNormal}" RenderTransformOrigin="0.5,0.5"/>
<Grid Width="21" Height="24" Margin="0,1.5,-2,0" MouseDown="Border_MouseDown" MouseUp="ImageEraser_MouseUp" Visibility="{Binding ElementName=BtnErase, Path=Visibility}">
<Image Margin="0,-4,-1,-2" Source="{DynamicResource ImageSource.RubberNormal}" RenderTransformOrigin="0.5,0.5"/>
</Grid>
<Grid Margin="0,0,0,0" Width="20">
<ui:SymbolIcon Symbol="Delete" Foreground="#666666" MouseDown="Border_MouseDown" MouseUp="SymbolIconDelete_MouseUp"/>
Expand Down
17 changes: 16 additions & 1 deletion Ink Canvas/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
if (response.Contains("Special Version") && !File.Exists(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Versions.ini"))
{
LogHelper.WriteLogToFile("Welcome Window Show Dialog", LogHelper.LogType.Event);

if (response.Contains("Special Version Alhua"))
{
WelcomeWindow.IsNewBuilding = true;
}
new WelcomeWindow().ShowDialog();
}
else
Expand All @@ -310,6 +315,16 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
lastVersion = File.ReadAllText(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Versions.ini");
}
catch { }
if (response.Contains("Special Version") && !lastVersion.Contains("3.2.5.0"))
{
LogHelper.WriteLogToFile("Welcome Window Show Dialog (Second time)", LogHelper.LogType.Event);

if (response.Contains("Special Version Alhua"))
{
WelcomeWindow.IsNewBuilding = true;
}
new WelcomeWindow().ShowDialog();
}
if (!lastVersion.Contains(version.ToString()))
{
LogHelper.WriteLogToFile("Change Log Window Show Dialog", LogHelper.LogType.Event);
Expand Down Expand Up @@ -1036,7 +1051,7 @@ private void ToggleSwitchModeFinger_Toggled(object sender, RoutedEventArgs e)
ToggleSwitchAutoEnterModeFinger.IsOn = ToggleSwitchModeFinger.IsOn;
if (ToggleSwitchModeFinger.IsOn)
{
BoundsWidth = 10; //35
BoundsWidth = 15; //35
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions Ink Canvas/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// 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("3.2.4.0")]
[assembly: AssemblyFileVersion("3.2.4.0")]
[assembly: AssemblyVersion("3.2.5.0")]
[assembly: AssemblyFileVersion("3.2.5.0")]
3 changes: 2 additions & 1 deletion Ink Canvas/WelcomeWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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">
Title="欢迎向导 - Ink Canvas 画板" Height="280" Width="400" Loaded="Window_Loaded">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
Expand All @@ -20,6 +20,7 @@
<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”"/>
<CheckBox Name="CheckBoxNewBuildingOptimization" FontFamily="Microsoft YaHei UI" Content="新综合楼优化"/>
</ui:SimpleStackPanel>
<Button Grid.Row="2" Margin="0,0,10,10" FontFamily="Microsoft YaHei UI"
HorizontalAlignment="Right" Content="确定" Width="100" Click="Button_Click"/>
Expand Down
27 changes: 26 additions & 1 deletion Ink Canvas/WelcomeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public WelcomeWindow()
InitializeComponent();
}

public static bool IsNewBuilding = false;

private void Button_Click(object sender, RoutedEventArgs e)
{
Close();
Expand Down Expand Up @@ -55,13 +57,36 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
MainWindow.Settings.Automation.IsAutoKillEasiNote = true;
}

if (CheckBoxNewBuildingOptimization.IsChecked == true)
{
MainWindow.Settings.Appearance.IsShowEraserButton = true;
MainWindow.Settings.Startup.IsAutoEnterModeFinger = true;
}

MainWindow.SaveSettingsToFile();

File.WriteAllText("versions.ini", Assembly.GetExecutingAssembly().GetName().Version.ToString());
string str = string.Empty;

try
{
str = File.ReadAllText(System.AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Versions.ini");
}
catch { }

str = (str + "\n" + Assembly.GetExecutingAssembly().GetName().Version.ToString()).Trim();
File.WriteAllText("versions.ini", str);
Process.Start(System.Windows.Forms.Application.ExecutablePath);

MainWindow.CloseIsFromButton = true;
Application.Current.Shutdown();
}

private void Window_Loaded(object sender, RoutedEventArgs e)
{
if (IsNewBuilding)
{
CheckBoxNewBuildingOptimization.IsChecked = true;
}
}
}
}

0 comments on commit ab87abf

Please sign in to comment.