Пример #1
0
 public void Next(string text, NeonAnimation animation)
 {
     _nextQueue.Enqueue(new NeonNext()
     {
         Text      = text,
         Animation = animation,
     });
     StartTimer(false);
 }
Пример #2
0
 public void Play(string text, NeonAnimation animation)
 {
     _playImmediately = new NeonNext()
     {
         Text      = text,
         Animation = animation,
     };
     StartTimer(true);
 }
Пример #3
0
 public void Next(string text, NeonAnimation animation, TimeSpan duration, TimeSpan?interval)
 {
     _nextQueue.Enqueue(new NeonNext()
     {
         Text      = text,
         Animation = animation,
         Duration  = duration,
         Interval  = interval,
     });
     StartTimer(false);
 }
Пример #4
0
 public void Play(string text, NeonAnimation animation, TimeSpan duration, TimeSpan?interval)
 {
     _playImmediately = new NeonNext()
     {
         Text      = text,
         Animation = animation,
         Duration  = duration,
         Interval  = interval,
     };
     StartTimer(true);
 }
Пример #5
0
        private void PlayStoryboard(Action completeAction)
        {
            switch (Animation)
            {
            case NeonAnimation.Notice:
                _storyboard = CreateNoticeStoryboard();
                break;

            case NeonAnimation.Marble:
                _storyboard = CreateMarbleStoryboard();
                break;

            case NeonAnimation.Barrage:
                _storyboard = CreateBarrageStoryboard();
                break;

            case NeonAnimation.Conspicuous:
                _storyboard = CreateConspicuousStoryboard();
                break;

            case NeonAnimation.FadeNext:
                _storyboard = CreateFadeNextStoryboard();
                break;

            default:
                return;
            }
            if (_storyboard == null)
            {
                completeAction?.Invoke();
                return;
            }
            _lastAnimation = Animation;
            if (BeginTime != null)
            {
                _storyboard.BeginTime = BeginTime;
            }
            _storyboard.Completed += delegate
            {
                completeAction?.Invoke();
            };

            _storyboard.Begin();
        }