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);
}