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()
|
public void Start()
|
||||||
{
|
{
|
||||||
IsOn = true;
|
IsOn = true;
|
||||||
|
NowIndex = 0;
|
||||||
StartWork();
|
StartWork();
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -212,7 +213,16 @@ public class ScheduleTask
|
|||||||
AutoReset = false
|
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 PackageWork { get; set; }
|
||||||
public Package PackageStudy { get; set; }
|
public Package PackageStudy { get; set; }
|
||||||
|
@ -92,7 +92,7 @@ public partial class winWorkMenu : WindowX
|
|||||||
else
|
else
|
||||||
sliderTaskLevel.TickFrequency = 5;
|
sliderTaskLevel.TickFrequency = 5;
|
||||||
tbtnCurrentPlan.IsChecked = mw.ScheduleTask.PackageWork?.IsActive() == true;
|
tbtnCurrentPlan.IsChecked = mw.ScheduleTask.PackageWork?.IsActive() == true;
|
||||||
btnStartSchedule.IsChecked = false;
|
btnStartSchedule.IsChecked = mw.ScheduleTask.IsOn;
|
||||||
|
|
||||||
AllowChange = true;
|
AllowChange = true;
|
||||||
combTaskType.SelectedIndex = 0;
|
combTaskType.SelectedIndex = 0;
|
||||||
@ -472,7 +472,7 @@ public partial class winWorkMenu : WindowX
|
|||||||
if (nowselefull.WorkType == Work.WorkType.Work)
|
if (nowselefull.WorkType == Work.WorkType.Work)
|
||||||
{
|
{
|
||||||
if (mw.ScheduleTask.PackageWork?.IsActive() == true
|
if (mw.ScheduleTask.PackageWork?.IsActive() == true
|
||||||
&& MessageBoxX.Show("工作套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) == MessageBoxResult.No)
|
&& MessageBoxX.Show("工作套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes)
|
||||||
return;
|
return;
|
||||||
mw.ScheduleTask.PackageWork = package;
|
mw.ScheduleTask.PackageWork = package;
|
||||||
rpnDisplay(mw.ScheduleTask.PackageWork, nowselefull.WorkType);
|
rpnDisplay(mw.ScheduleTask.PackageWork, nowselefull.WorkType);
|
||||||
@ -480,7 +480,7 @@ public partial class winWorkMenu : WindowX
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mw.ScheduleTask.PackageStudy?.IsActive() == true
|
if (mw.ScheduleTask.PackageStudy?.IsActive() == true
|
||||||
&& MessageBoxX.Show("学习套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) == MessageBoxResult.No)
|
&& MessageBoxX.Show("学习套餐已激活,是否替换?".Translate(), "套餐已激活".Translate(), MessageBoxButton.YesNo) != MessageBoxResult.Yes)
|
||||||
return;
|
return;
|
||||||
mw.ScheduleTask.PackageStudy = package;
|
mw.ScheduleTask.PackageStudy = package;
|
||||||
rpnDisplay(mw.ScheduleTask.PackageStudy, nowselefull.WorkType);
|
rpnDisplay(mw.ScheduleTask.PackageStudy, nowselefull.WorkType);
|
||||||
|
Loading…
Reference in New Issue
Block a user