代码清理

This commit is contained in:
PrefacedCorg
2025-12-27 12:05:34 +08:00
parent d7e8330016
commit 783e5c43a5
9 changed files with 53 additions and 46 deletions
+3 -4
View File
@@ -107,8 +107,7 @@ namespace Ink_Canvas
if (settings.RandSettings.SelectedBackgroundIndex <= 0)
{
// 没有自定义背景时,使用主题背景色
var backgroundBrush = Application.Current.FindResource("RandWindowBackground") as SolidColorBrush;
if (backgroundBrush != null)
if (Application.Current.FindResource("RandWindowBackground") is SolidColorBrush backgroundBrush)
{
MainBorder.Background = backgroundBrush;
}
@@ -238,7 +237,7 @@ namespace Ink_Canvas
int randomIndex = random.Next(0, animationPool.Count);
int selectedNumber = animationPool[randomIndex];
int lastIndex = animationPool.Count - 1;
if (randomIndex != lastIndex)
{
@@ -273,7 +272,7 @@ namespace Ink_Canvas
{
int randomIndex = random.Next(0, candidatePool.Count);
int selectedNumber = candidatePool[randomIndex];
int lastIndex = candidatePool.Count - 1;
if (randomIndex != lastIndex)
{