AnimationModels.Animation.InsertFrame C# (CSharp) Method

InsertFrame() public method

public InsertFrame ( int index, KeyFrame frame ) : void
index int
frame KeyFrame
return void
        public void InsertFrame(int index, KeyFrame frame)
        {
            if (frame.ColumnCount != this.ColumnCount)
            {
                throw new ArgumentException("All keyframes must have " + this.ColumnCount + " columns", "frame");
            }

            if (frame.RowCount != this.RowCount)
            {
                throw new ArgumentException("All keyframes must have " + this.RowCount + " rows", "frame");
            }

            if (index < 0 || index >= this.Frames.Count - 1)
            {
                throw new ArgumentException("Index is out of range.", "index");
            }

            this.frames.Insert(index, frame);
        }