修改格式,处理版本,增加复选框限制

This commit is contained in:
cgl
2022-06-03 20:51:01 +08:00
parent a1d56afb4a
commit 7ef01840a1
6 changed files with 32 additions and 7 deletions

View File

@@ -97,7 +97,9 @@
<CheckBox
x:Name="usesystemnote" Content="使用Windows系统推送通知支持Win10/Win11" HorizontalAlignment="Left"
Margin="10,0,0,0" VerticalAlignment="Center"
IsChecked="{Binding ToastUsingSystem}" Height="20" Width="450"/>
IsChecked="{Binding ToastUsingSystem}"
IsEnabled="{Binding ToastOS}"
Height="20" Width="450"/>
</Grid>
<Button

View File

@@ -563,7 +563,30 @@ namespace MeoAsstGui
//是否使用系统通知
private bool _toastUsingSystem = Convert.ToBoolean(ViewStatusStorage.Get("Toast.UsingSystem", bool.FalseString));
private bool _toastControl = Convert.ToBoolean(bool.TrueString);
private bool _toastOS = Convert.ToBoolean(bool.TrueString);
public bool toastOScheck()
{
var os = Environment.OSVersion.Version;
if (os.ToString().CompareTo("10.0.0.10240") > 0)
{
return true;
}
else
{
ViewStatusStorage.Set("Toast.UsingSystem", bool.FalseString);
ToastUsingSystem = false;
ToastControl = true;
return false;
}
}
public bool ToastOS
{
get { return toastOScheck(); }
set
{
SetAndNotify(ref _toastOS, value);
}
}
public bool ToastControl
{
get { return !_toastUsingSystem; }

View File

@@ -174,8 +174,8 @@ namespace MeoAsstGui
using (var toast = new ToastNotification("更新文件不正确!"))
{
toast.AppendContentText("文件名: " + UpdatePackageName)
.AppendContentText("已将其删除!")
.ShowUpdateVersion();
.AppendContentText("已将其删除!")
.ShowUpdateVersion();
}
});
return false;

View File

@@ -28,7 +28,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

View File

@@ -25,7 +25,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

View File

@@ -28,7 +28,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>