Esempio n. 1
0
        protected void AddLastFrame(KeyFrame frame)
        {
            if (this.lastFrame == null)
            {
                this.firstFrame = frame;
                this.lastFrame = frame;
            }
            else
            {
                if (frame.Time <= this.lastFrame.Time)
                    throw new ArgumentException("time must be greater than last frame");

                AddFrameAfter(this.lastFrame, frame);
            }
        }
Esempio n. 2
0
        protected void AddFrameBefore(KeyFrame frame, KeyFrame newFrame)
        {
            if (frame.Previous != null)
            {
                frame.Previous.Next = newFrame;
                newFrame.Previous = frame.Previous;
            }
            else
            {
                this.firstFrame = newFrame;
            }

            frame.Previous = newFrame;
            newFrame.Next = frame;
        }
Esempio n. 3
0
        internal void RemoveFramesBefore(int time)
        {
            if (LastFrame == null)
                throw new ArgumentException("No key frame is added");

            if (time >= LastFrame.Time)
                throw new ArgumentException("Cannot remove first frame");

            var frame = FindFrameBefore(time);
            if (frame != null)
            {
                frame.Next.Previous = null;

                this.firstFrame = frame.Next;
            }
        }
Esempio n. 4
0
        protected void AddFrameAfter(KeyFrame frame, KeyFrame newFrame)
        {
            if (frame.Next != null)
            {
                frame.Next.Previous = newFrame;
                newFrame.Next = frame.Next;
            }
            else
            {
                this.lastFrame = newFrame;
            }

            frame.Next = newFrame;
            newFrame.Previous = frame;
        }
Esempio n. 5
0
        internal void RemoveFramesAfter(int time)
        {
            if (FirstFrame == null)
                throw new ArgumentException("No key frame is added");

            if (time <= FirstFrame.Time)
                throw new ArgumentException("Cannot remove first frame");

            var frame = FindFrameAfter(time);
            if (frame != null)
            {
                frame.Previous.Next = null;

                this.lastFrame = frame.Previous;
            }
        }