/// <summary>
/// 实际执行过程,某个子动作成功执行后,将调用该方法继续执行后面的动作
/// </summary>
private void Excute()
{
while (index < Count)
{
BaseAsyncAction action = (BaseAsyncAction)this[index++];
if (action.CanSave)
{
action.Invoke();
//如果是异步动作,退出,等待异步动作完成
if (action is IAsyncAction)
{
return;
}
}
}
//所有动作执行完毕,index还原,并通知完成
index = 0;
IsBusy = false;
State = State.End;
OnCompleted(new AsyncCompletedEventArgs(null, false, null));
}