Skip to content

Commit ccf6885

Browse files
committed
完善了提示更新
1 parent ef72270 commit ccf6885

File tree

2 files changed

+15
-17
lines changed

2 files changed

+15
-17
lines changed

MainWindow.xaml.cs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -589,31 +589,27 @@ public void CheckUpdate()
589589
//不再检查
590590
case "1999/7/24 0:00:00":
591591
return;
592+
592593
//第一次打开初始化日期
593594
case "2021/4/16 0:00:00":
594595
Settings.Default.LastOpenDate = DateTime.Today;
596+
Settings.Default.Save();
595597
break;
596598

597599
default:
600+
var daySpan = DateTime.Today.Subtract(Settings.Default.LastOpenDate);
601+
if (daySpan.Days > 30)
598602
{
599-
var daySpan = DateTime.Today.Subtract(Settings.Default.LastOpenDate);
600-
if (daySpan.Days > 10)
603+
var notifyUpdate = new
604+
NotifyUpdate("打扰一下,您已经使用这个软件版本很久啦!\n\n或许已经有新版本了,欢迎前去公众号获取最新版。✨",
605+
"知道啦", "别再提示")
601606
{
602-
var notifyUpdate = new
603-
NotifyUpdate("打扰一下,您已经使用这个软件版本很久啦!\n\n或许已经有新版本了,欢迎前去公众号获取最新版。✨",
604-
"知道啦", "别再提示")
605-
{
606-
Owner = this
607-
};
608-
notifyUpdate.Show();
609-
Settings.Default.LastOpenDate = DateTime.Today;
610-
}
611-
612-
break;
607+
Owner = this
608+
};
609+
notifyUpdate.Show();
613610
}
611+
break;
614612
}
615-
616-
Settings.Default.Save();
617613
}
618614

619615
private void MainWindow_OnContentRendered(object sender, EventArgs e)

NotifyUpdate.xaml.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ public void Button2_Click(object sender, RoutedEventArgs e)
2929
{
3030
Settings.Default.LastOpenDate = new DateTime(1999, 7, 24);
3131
Settings.Default.Save();
32-
this.Close();
32+
Close();
3333
}
3434

3535
private void Button1_Click(object sender, RoutedEventArgs e)
3636
{
37-
this.Close();
37+
Settings.Default.LastOpenDate = DateTime.Today;
38+
Settings.Default.Save();
39+
Close();
3840
}
3941
}
4042
}

0 commit comments

Comments
 (0)