示例#1
0
 /// <summary>
 /// This will stop the current timeline, without playing post actions
 /// and start the new timeline optionally playing pre and post actions
 /// on the new timeline.
 /// </summary>
 /// <param name="timeline">The new timeline to play.</param>
 /// <param name="playNewTimelinePrePostAction">True to play pre and post actions.</param>
 public void stopAndStartPlayback(Timeline timeline, bool playNewTimelinePrePostAction)
 {
     if (updating)
     {
         if (TimelinePlaybackStopped != null)
         {
             TimelinePlaybackStopped.Invoke(this, EventArgs.Empty);
         }
         activeTimeline.stop(false);
         previousTimeline = activeTimeline;
         mainTimer.removeUpdateListener(this);
         activeTimeline.TimelineController = null;
         activeTimeline = null;
         updating       = false;
     }
     if (timeline != null)
     {
         startPlayback(timeline, playNewTimelinePrePostAction);
         clearQueuedTimeline();
     }
 }
示例#2
0
        public void stopPlayback(bool playPostActions)
        {
            if (updating)
            {
                activeTimeline.stop(playPostActions);
                previousTimeline = activeTimeline;
                mainTimer.removeUpdateListener(this);
                activeTimeline.TimelineController = null;
                activeTimeline = null;
                updating       = false;

                if (TimelinePlaybackStopped != null)
                {
                    TimelinePlaybackStopped.Invoke(this, EventArgs.Empty);
                }

                if (queuedTimeline != null)
                {
                    startPlayback(queuedTimeline, playPostActions);
                    clearQueuedTimeline();
                }
            }
        }