|
|
|
@@ -595,6 +595,15 @@ namespace Novacode |
|
|
|
return InsertRow(RowCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Insert a copy of a row at the end of this table.
|
|
|
|
/// </summary>
|
|
|
|
/// <returns>A new row.</returns>
|
|
|
|
public Row InsertRow(Row row)
|
|
|
|
{
|
|
|
|
return InsertRow(row, RowCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Insert a column to the right of a Table.
|
|
|
|
/// </summary>
|
|
|
|
@@ -807,6 +816,35 @@ namespace Novacode |
|
|
|
return newRow;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Insert a copy of a row into this table.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="row">Row to copy and insert.</param>
|
|
|
|
/// <param name="index">Index to insert row at.</param>
|
|
|
|
/// <returns>A new Row</returns>
|
|
|
|
public Row InsertRow(Row row, int index)
|
|
|
|
{
|
|
|
|
if (index < 0 || index > RowCount)
|
|
|
|
throw new IndexOutOfRangeException();
|
|
|
|
|
|
|
|
Row newRow = new Row(this, Document, row.Xml);
|
|
|
|
|
|
|
|
XElement rowXml;
|
|
|
|
if (index == Rows.Count)
|
|
|
|
{
|
|
|
|
rowXml = Rows.Last().Xml;
|
|
|
|
rowXml.AddAfterSelf(newRow.Xml);
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rowXml = Rows[index].Xml;
|
|
|
|
rowXml.AddBeforeSelf(newRow.Xml);
|
|
|
|
}
|
|
|
|
|
|
|
|
return newRow;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Insert a column into a table.
|
|
|
|
/// </summary>
|