Skip to content

Commit

Permalink
fix: 修复当自动发送时间间隔输入非法参数时可能引起的意外错误
Browse files Browse the repository at this point in the history
  • Loading branch information
leven99 committed Oct 27, 2019
1 parent 43144f1 commit e671819
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Models/SendM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public string SendData
/// <summary>
/// 辅助区 - 自送发送的时间间隔
/// </summary>
private int _AutoSendNum;
public int AutoSendNum
private string _AutoSendNum;
public string AutoSendNum
{
get
{
Expand Down Expand Up @@ -136,7 +136,7 @@ public void SendDataContext()
SendData = string.Empty;
SendDataCount = 0;

AutoSendNum = 1000;
AutoSendNum = "1000";

/* 发送换行 */
NonesEnable = true;
Expand Down
4 changes: 2 additions & 2 deletions ViewModels/MainWindowVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -711,13 +711,13 @@ public bool AutoSend

if (AutoSend == true)
{
if (SendModel.AutoSendNum <= 0)
if (String.IsNullOrWhiteSpace(SendModel.AutoSendNum))
{
DepictInfo = string.Format(cultureInfo, "请输入正确的发送时间间隔");
return;
}

StartAutoSendTimer(SendModel.AutoSendNum);
StartAutoSendTimer(Convert.ToInt32(SendModel.AutoSendNum, cultureInfo));
}
else
{
Expand Down

0 comments on commit e671819

Please sign in to comment.