ZForge.Controls.XPTable.Models.RowCollection.InsertRange C# (CSharp) Method

InsertRange() public method

Inserts an array of Rows into the collection at the specified index
public InsertRange ( int index, Row rows ) : void
index int The zero-based index at which the rows /// should be inserted
rows Row The array of Rows to be inserted into /// the collection
return void
        public void InsertRange(int index, Row[] rows)
        {
            if (rows == null)
            {
                throw new System.ArgumentNullException("Row[] is null");
            }

            if (index < 0)
            {
                throw new IndexOutOfRangeException();
            }

            if (index >= this.Count)
            {
                this.AddRange(rows);
            }
            else
            {
                for (int i=rows.Length-1; i>=0; i--)
                {
                    this.Insert(index, rows[i]);
                }
            }
        }