JAction
并行
bool condition = false;
JAction doj = new JAction()
.Do(() =>
{
Log.Print("JAction 用了Do");
})
.Delay(3)
.Do(()=>{
Log.Print("延时了3秒");
})
.Delay(3)
.Do(() => condition = true)
.Until(()=>condition)
.Do(()=> { Log.Print($"条件等待完成,等待的条件现在是{condition}"); })
.Execute();
循环
int i = 10;
JAction doj = new JAction()
.Repeat(() =>
{
i--;
Log.Print($"i");
}, 10, 1) .Execute();
条件
bool condition = false;
JAction doj = new JAction()
.RepeatWhen(() =>
{
i--;
Log.Print($"i");
}, ()=> condition =false,1)
.Execute();
取消
.OncCancel(()=>{}); 监听取消事件
.Cancel() 取消事件