private void CopyEventsSubscriptionsHandler(out List <TimeChangedDelegate> durationChangedSubscriptions, out List <TimeChangedDelegate> currentTimeChangedSubscriptions, out List <TimeDelegate> timeFlowStartedSubscriptions, out List <TimeDelegate> timeFlowStoppedSubscriptions, out List <TimeDelegate> timeFlowPausedSubscriptions) { durationChangedSubscriptions = new List <TimeChangedDelegate>(); currentTimeChangedSubscriptions = new List <TimeChangedDelegate>(); timeFlowStartedSubscriptions = new List <TimeDelegate>(); timeFlowStoppedSubscriptions = new List <TimeDelegate>(); timeFlowPausedSubscriptions = new List <TimeDelegate>(); if (DurationChanged != null) { durationChangedSubscriptions = Array.ConvertAll(DurationChanged.GetInvocationList(), item => (TimeChangedDelegate)item).ToList(); } if (CurrentTimeChanged != null) { currentTimeChangedSubscriptions = Array.ConvertAll(CurrentTimeChanged.GetInvocationList(), item => (TimeChangedDelegate)item).ToList(); } if (TimeFlowStarted != null) { timeFlowStartedSubscriptions = Array.ConvertAll(TimeFlowStarted.GetInvocationList(), item => (TimeDelegate)item).ToList(); } if (TimeFlowStopped != null) { timeFlowStoppedSubscriptions = Array.ConvertAll(TimeFlowStopped.GetInvocationList(), item => (TimeDelegate)item).ToList(); } if (TimeFlowPaused != null) { timeFlowPausedSubscriptions = Array.ConvertAll(TimeFlowPaused.GetInvocationList(), item => (TimeDelegate)item).ToList(); } }
/// <summary>Pause the timeflow and set current time to 0.</summary> public void StopTimeFlowEngine() { _isPlaying = false; if (TimeFlowStopped != null) { TimeFlowStopped.Invoke(_time); } SetTime(0); }