mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
修复停止工作导致的循环错误
This commit is contained in:
parent
ddb434667f
commit
b9d6c98f77
@ -195,6 +195,7 @@ public class ScheduleTask
|
||||
public void Start()
|
||||
{
|
||||
IsOn = true;
|
||||
NowIndex = 0;
|
||||
StartWork();
|
||||
}
|
||||
/// <summary>
|
||||
@ -212,7 +213,16 @@ public class ScheduleTask
|
||||
AutoReset = false
|
||||
};
|
||||
|
||||
private void WorkTimer_E_FinishWork(Core.WorkTimer.FinishWorkInfo obj) => StartWork();
|
||||
private void WorkTimer_E_FinishWork(Core.WorkTimer.FinishWorkInfo obj)
|
||||
{
|
||||
if (obj.spendtime < obj.work.Time / 2)
|
||||
Stop();
|
||||
else
|
||||
{
|
||||
RestTime = 1;
|
||||
RestTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
public Package PackageWork { get; set; }
|
||||
public Package PackageStudy { get; set; }
|
||||
|
@ -92,7 +92,7 @@ public partial class winWorkMenu : WindowX
|
||||
else
|
||||
sliderTaskLevel.TickFrequency = 5;
|
||||
tbtnCurrentPlan.IsChecked = mw.ScheduleTask.PackageWork?.IsActive() == true;
|
||||
btnStartSchedule.IsChecked = false;
|
||||
btnStartSchedule.IsChecked = mw.ScheduleTask.IsOn;
|
||||
|
||||
AllowChange = true;
|
||||
combTaskType.SelectedIndex = 0;
|
||||
@ -472,7 +472,7 @@ public partial class winWorkMenu : WindowX
|
||||
if (nowselefull.WorkType == Work.WorkType.Work)
|
||||
{
|
||||
if (mw.ScheduleTask.PackageWork?.IsActive() == true
|
||||
&& MessageBoxX.Show("工作套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
&& MessageBoxX.Show("工作套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes)
|
||||
return;
|
||||
mw.ScheduleTask.PackageWork = package;
|
||||
rpnDisplay(mw.ScheduleTask.PackageWork, nowselefull.WorkType);
|
||||
@ -480,7 +480,7 @@ public partial class winWorkMenu : WindowX
|
||||
else
|
||||
{
|
||||
if (mw.ScheduleTask.PackageStudy?.IsActive() == true
|
||||
&& MessageBoxX.Show("学习套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) == MessageBoxResult.No)
|
||||
&& MessageBoxX.Show("学习套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes)
|
||||
return;
|
||||
mw.ScheduleTask.PackageStudy = package;
|
||||
rpnDisplay(mw.ScheduleTask.PackageStudy, nowselefull.WorkType);
|
||||
|
Loading…
Reference in New Issue
Block a user