Skip to content

Commit dda0e82

Browse files
committed
修复错误,并且现在高透云母更加通透
1 parent b0e9c27 commit dda0e82

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

Helper/SouXiaoEngineScan.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
namespace ScanEngine
1+
using PublicPart;
2+
3+
namespace Helper
24
{
35
/// <summary>
46
/// Wrapper around the SouXiao heuristic engine for file scanning.
@@ -43,7 +45,7 @@ public bool Initialize()
4345
{
4446
foreach (var item1 in item.Value)
4547
{
46-
if (!(item1 == EngineResult.Safe || item1 == EngineResult.UnSupport))
48+
if (item1 is not (EngineResult.Safe or EngineResult.UnSupport))
4749
{
4850
return (true, $"SouXiao.Heuristic.{item.Key}");
4951
}

Xdows-Security/MainWindow.Backdrop.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
using Microsoft.UI.Composition;
55
using Microsoft.UI.Composition.SystemBackdrops;
66
using Microsoft.UI.Xaml;
7-
using Microsoft.UI.Xaml.Controls;
87
using Microsoft.UI.Xaml.Media;
98
using System;
109
using Windows.UI;
@@ -18,7 +17,6 @@ public sealed partial class MainWindow
1817
private double _lastOpacity = 100;
1918
private ISystemBackdropControllerWithTargets? _controller;
2019
private ICompositionSupportsSystemBackdrop? _target;
21-
2220
private static readonly SystemBackdropConfiguration _config = new()
2321
{
2422
IsInputActive = true
@@ -35,7 +33,7 @@ public static void UpdateTheme(ElementTheme selectedTheme)
3533
{
3634
_ = Microsoft.UI.Windowing.AppWindow.GetFromWindowId(
3735
Microsoft.UI.Win32Interop.GetWindowIdFromWindow(
38-
WinRT.Interop.WindowNative.GetWindowHandle(window)
36+
WinRT.Interop.WindowNative.GetWindowHandle(window)
3937
)
4038
);
4139

@@ -107,7 +105,8 @@ public void ApplyBackdrop(string backdropType, bool compulsory)
107105
backdropType = "Acrylic";
108106

109107
RootGrid.Background = new SolidColorBrush(Colors.Transparent);
110-
_target = this.As<ICompositionSupportsSystemBackdrop>();
108+
109+
_target = (ICompositionSupportsSystemBackdrop)(object)this;
111110

112111
switch (backdropType)
113112
{
@@ -121,7 +120,7 @@ public void ApplyBackdrop(string backdropType, bool compulsory)
121120
case "MicaAlt":
122121
_controller = new MicaController()
123122
{
124-
LuminosityOpacity = (float)(opacity / 100 * 0.95),
123+
LuminosityOpacity = (float)(opacity / 100 * 0.85),
125124
TintColor = GetBackgroundColor(),
126125
Kind = MicaKind.BaseAlt
127126
};
@@ -232,8 +231,7 @@ private void UpdateBackgroundImage()
232231

233232
public void UpdateBackgroundImageOpacity(double opacity)
234233
{
235-
if (_backgroundImageBrush != null)
236-
_backgroundImageBrush.Opacity = opacity;
234+
_backgroundImageBrush?.Opacity = opacity;
237235
}
238236

239237
private void OnThemeChanged(FrameworkElement sender, object args)
@@ -243,4 +241,4 @@ private void OnThemeChanged(FrameworkElement sender, object args)
243241
ApplyBackdrop(backdrop, true);
244242
}
245243
}
246-
}
244+
}

Xdows-Security/TCPMessageProtocol.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.IO;
44
using System.Text;
55
using System.Text.Json;
6+
using System.Threading.Tasks;
67

78
namespace Xdows_Security
89
{
@@ -53,7 +54,7 @@ public static byte[] EncodeMessage(Dictionary<string, object> message)
5354
}
5455
int messageLength = BitConverter.ToInt32(networkOrderBytes, 0);
5556

56-
if (messageLength <= 0 || messageLength > 10 * 1024 * 1024)
57+
if (messageLength is <= 0 or > (10 * 1024 * 1024))
5758
{
5859
return null;
5960
}

0 commit comments

Comments
 (0)