代码清理
This commit is contained in:
@@ -591,9 +591,9 @@ namespace Ink_Canvas
|
||||
for (int i = 0; i < count && candidatePool.Count > 0; i++)
|
||||
{
|
||||
int randomIndex = random.Next(0, candidatePool.Count);
|
||||
|
||||
|
||||
selectedNames.Add(candidatePool[randomIndex]);
|
||||
|
||||
|
||||
int lastIndex = candidatePool.Count - 1;
|
||||
if (randomIndex != lastIndex)
|
||||
{
|
||||
@@ -1258,17 +1258,17 @@ namespace Ink_Canvas
|
||||
// 清空名单
|
||||
nameList.Clear();
|
||||
UpdateListCountDisplay();
|
||||
|
||||
|
||||
// 清空点名历史记录
|
||||
lock (historyLock)
|
||||
{
|
||||
// 重置历史记录数据
|
||||
historyData = new RollCallHistoryData();
|
||||
|
||||
|
||||
// 保存到文件
|
||||
SaveRollCallHistory();
|
||||
}
|
||||
|
||||
|
||||
UpdateStatusDisplay("名单和历史记录已清空");
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user