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