Exemplo n.º 1
0
        public virtual void Play(KeyType key, bool forceReset = true)
        {
            if (IsDisposed)
            {
                return;
            }

            IsPlaying = true;
            if (CurrentTrack == null || !CurrentKey.Equals(key))
            {
                CurrentKey   = key;
                CurrentTrack = Tracks[CurrentKey];
                ElapsedTime  = 0;

                if (forceReset)
                {
                    CurrentTrack.Reset();
                }

                UpdateClippingRegion();
            }
            else if (forceReset)
            {
                ElapsedTime = 0;
                CurrentTrack.Reset();
                UpdateClippingRegion();
            }
        }
Exemplo n.º 2
0
 public void Stop()
 {
     Pause();
     CurrentTrack.Reset();
     UpdateClippingRegion();
     ElapsedTime = 0;
 }
Exemplo n.º 3
0
        public void Play(bool forceReset = true)
        {
            if (CurrentTrack == null)
            {
                throw new System.InvalidOperationException("Animation can't play or resume an invalid track");
            }

            IsPlaying = true;
            if (forceReset)
            {
                ElapsedTime = 0;
                CurrentTrack.Reset();
                UpdateClippingRegion();
            }
        }