public void CancelActiveActions() { foreach (var target in targets) { var tcs = target.Value.ActionStates.LastOrDefault(); TaskSourceState taskSourceState = tcs as TaskSourceState; if (taskSourceState != null) { taskSourceState.Cancel(); continue; } var seqState = tcs as SequenceState; seqState?.Cancel(); } }
public void CancelActiveActions() { //this might be very slow when debugged is attached. foreach (var target in targets) { var tcs = target.Value.ActionStates.LastOrDefault(); TaskSourceState taskSourceState = tcs as TaskSourceState; if (taskSourceState != null) { taskSourceState.Cancel(); continue; } var seqState = tcs as SequenceState; seqState?.Cancel(); } }