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> Launch the timeflow.</summary> public void StartTimeFlowEngine() { if (!_isPlaying && _time.TotalSeconds == _duration) { SetTime(0); } _isPlaying = true; if (TimeFlowStarted != null) { TimeFlowStarted.Invoke(_time); } }