Skip to content

Commit

Permalink
Finishing 2024: Fixing some warnings and improving code quality
Browse files Browse the repository at this point in the history
Finishing 2024: Fixing some warnings and improving code quality
  • Loading branch information
Gaoyifei1011 committed Dec 31, 2024
1 parent 3117255 commit d64c448
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions WindowsTools/UI/Backdrop/DesktopAcrylicBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
using WindowsTools.WindowsAPI.PInvoke.Kernel32;
using WindowsTools.WindowsAPI.PInvoke.User32;

// 抑制 CA1822 警告
#pragma warning disable CA1822
// 抑制 CA1822,IDE0060 警告
#pragma warning disable CA1822,IDE0060

namespace WindowsTools.UI.Backdrop
{
Expand Down
4 changes: 2 additions & 2 deletions WindowsTools/UI/Backdrop/MicaBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
using WindowsTools.WindowsAPI.PInvoke.Kernel32;
using WindowsTools.WindowsAPI.PInvoke.User32;

// 抑制 CA1822 警告
#pragma warning disable CA1822
// 抑制 CA1822,IDE0060 警告
#pragma warning disable CA1822,IDE0060

namespace WindowsTools.UI.Backdrop
{
Expand Down
4 changes: 2 additions & 2 deletions WindowsTools/UI/Dialogs/AppInformationDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
using WindowsTools.UI.TeachingTips;
using WindowsTools.WindowsAPI.PInvoke.KernelAppCore;

// 抑制 CA1806 警告
#pragma warning disable CA1806
// 抑制 CA1806,IDE0060 警告
#pragma warning disable CA1806,IDE0060

namespace WindowsTools.UI.Dialogs
{
Expand Down
4 changes: 2 additions & 2 deletions WindowsTools/Views/Pages/PriExtractPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
using WindowsTools.WindowsAPI.ComTypes;
using WindowsTools.WindowsAPI.PInvoke.Shell32;

// 抑制 CA1806,IDE0060 警告
#pragma warning disable CA1806,IDE0060
// 抑制 CA1806,CA1822,IDE0060 警告
#pragma warning disable CA1806,CA1822,IDE0060

namespace WindowsTools.Views.Pages
{
Expand Down
5 changes: 4 additions & 1 deletion WindowsTools/Views/Pages/WinSATPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@
<Grid
Grid.Row="2"
Margin="30,0,30,3"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}">
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="{StaticResource ControlCornerRadius}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
Expand Down
2 changes: 1 addition & 1 deletion WindowsTools/Views/Windows/LoafWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected override void OnFormClosed(FormClosedEventArgs args)
protected override void OnSizeChanged(EventArgs args)
{
base.OnSizeChanged(args);
User32Library.SetWindowPos(hwndXamlIsland, IntPtr.Zero, Location.X, Location.Y, Width, Height, SetWindowPosFlags.SWP_NOACTIVATE | SetWindowPosFlags.SWP_NOZORDER | SetWindowPosFlags.SWP_SHOWWINDOW);
User32Library.SetWindowPos(hwndXamlIsland, IntPtr.Zero, 0, 0, Width, Height, SetWindowPosFlags.SWP_NOACTIVATE | SetWindowPosFlags.SWP_NOZORDER | SetWindowPosFlags.SWP_SHOWWINDOW);
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion WindowsTools/WindowsAPI/PInvoke/User32/SM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public enum SM : int
/// 窗口周围具有描述文字但不是相当大的(以像素为单位)的框架的粗细。 SM_CXFIXEDFRAME是水平边框的高度,SM_CYFIXEDFRAME是垂直边框的宽度。
/// 此值与 SM_CXDLGFRAME 相同。
/// </summary>
SM_CXFIXEDFRAME = 7,
SM_CXFIXEDFRAME = SM_CXDLGFRAME,

/// <summary>
/// DrawFocusRect 绘制的焦点矩形的左边缘和右边缘的宽度。 此值以像素为单位。
Expand Down
3 changes: 3 additions & 0 deletions WindowsToolsShellExtension/Commands/ExplorerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
using WindowsToolsShellExtension.WindowsAPI.PInvoke.Shell32;
using WindowsToolsShellExtension.WindowsAPI.PInvoke.Shlwapi;

// 抑制 CA1822 警告
#pragma warning disable CA1822

namespace WindowsToolsShellExtension.Commands
{
/// <summary>
Expand Down

0 comments on commit d64c448

Please sign in to comment.