Skip to content

Commit cbb0af5

Browse files
committed
修复启动时列表不自动刷新的bug
提供完全禁用选项 增加重置时间功能
1 parent 214999b commit cbb0af5

File tree

6 files changed

+49
-25
lines changed

6 files changed

+49
-25
lines changed

TimeControl/AppController.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,5 +119,12 @@ public void RemoveAll(Timer timer, ListBox listBox)
119119
apps.Clear();
120120
Refresh(timer, listBox);
121121
}
122+
123+
public void ResetAll(Timer timer, ListBox listBox)
124+
{
125+
foreach (App app in apps)
126+
app.Reset();
127+
Refresh(timer, listBox);
128+
}
122129
}
123130
}

TimeControl/ControlPanel.Designer.cs

Lines changed: 27 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TimeControl/ControlPanel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ private void ControlPanel_Shown(object sender, EventArgs e)//启动隐藏参数
160160
}
161161

162162
processMonitorTimer.Start();
163+
UpdateForm();
163164
}
164165

165166
private void UnloackPasswordSetButton_Click(object sender, EventArgs e)//保存密码
@@ -197,5 +198,10 @@ private bool PasswordCheck()//检测密码是否正确
197198
else
198199
return true;
199200
}
201+
202+
private void resetButton_Click(object sender, EventArgs e)
203+
{
204+
controller.ResetAll(processMonitorTimer, usageBox);
205+
}
200206
}
201207
}

TimeControl/LimitedApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override string ToString()
4646
}
4747

4848
/// <summary>
49-
/// 禁用掉该程序
49+
/// 关闭掉该程序,并提前设置为完全禁用
5050
/// </summary>
5151
public void Ban()
5252
{

TimeControl/TimeInput.Designer.cs

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TimeControl/TimeInput.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ public TimeInput(AppController appController, string appName, Timer timer, ListB
3434
private void OkButton_Click(object sender, EventArgs e)
3535
{
3636
if (timeBox.Value == 0)
37-
{
37+
appController.AddByName(appName, 0, timer, listBox);
38+
else if (timeBox.Value == 1)
3839
appController.AddByName(appName, timer, listBox);
39-
}
4040
else
41-
{
4241
appController.AddByName(appName, Convert.ToInt32(timeBox.Value), timer, listBox);
43-
}
4442
Close();
4543
}
4644
}

0 commit comments

Comments
 (0)