Class RowCollection
Represents a collection of Row instances.
public sealed class RowCollection : IList<Row>, ICollection<Row>, IEnumerable<Row>, IEnumerable
- Inheritance
-
RowCollection
- Implements
- Inherited Members
- Extension Methods
Constructors
RowCollection(ColumnCollection)
Initializes a new instance of the RowCollection class.
public RowCollection(ColumnCollection columns)
Parameters
columnsColumnCollectionThe column collection this collection is bound to.
Properties
Columns
Gets the column collection this collection is bound to.
public ColumnCollection Columns { get; }
Property Value
- ColumnCollection
The ColumnCollection this collection is bound to or
nullif this collection is not bound to columns, yet.
Count
Gets the number of rows contained in the collection.
public int Count { get; }
Property Value
- int
The number of rows contained in the collection.
IsReadOnly
Gets a value indicating whether the collection is read-only.
public bool IsReadOnly { get; }
Property Value
- bool
trueif the collection is read-only; otherwise,false.
this[int]
Gets or sets the Row at the specified index.
public Row this[int index] { get; set; }
Parameters
indexint
Property Value
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the collection.- ArgumentNullException
If
valueisnull.
Methods
Add(Row)
Adds the specified row.
public void Add(Row row)
Parameters
rowRowThe row to add.
Exceptions
- ArgumentNullException
If
rowisnull.
Add(object[])
Adds a new row containing the specified values.
public void Add(object[] values)
Parameters
valuesobject[]The values for the new row to add.
Add(string[])
Adds a new row containing the specified values.
public void Add(string[] values)
Parameters
valuesstring[]The values for the new row to add.
Clear()
Removes all rows from the collection.
public void Clear()
Exceptions
- NotSupportedException
The collection is read-only.
Contains(Row)
Determines whether the collection contains the specified row.
public bool Contains(Row item)
Parameters
itemRowThe row to locate in the collection.
Returns
- bool
trueifitemis found in the collection; otherwise,false.
CopyTo(Row[], int)
public void CopyTo(Row[] array, int arrayIndex)
Parameters
arrayRow[]The one-dimensional Array that is the destination of the elements copied from the collection. The Array must have zero-based indexing.
arrayIndexintThe zero-based index in
arrayat which copying begins.
Exceptions
- ArgumentNullException
arrayis null.- ArgumentOutOfRangeException
arrayIndexis less than 0.- ArgumentException
<code class="paramref">array</code> is multidimensional.-or-
arrayIndexis equal to or greater than the length ofarray. -or- The number of elements in the source collection is greater than the available space fromarrayIndexto the end of the destinationarray.
CreateCopy(ColumnCollection)
Creates a deep copy of this collection.
public RowCollection CreateCopy(ColumnCollection columns)
Parameters
columnsColumnCollectionThe column collection the copied collection is bound to.
Returns
- RowCollection
A new row collection bound to
columnsand containing rows with the same values as the rows in this collection.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<Row> GetEnumerator()
Returns
- IEnumerator<Row>
An enumerator that can be used to iterate through the collection.
IndexOf(Row)
Determines the index of a specific item in the collection.
public int IndexOf(Row item)
Parameters
itemRowThe row to locate in the collection.
Returns
- int
The index of
itemif found in the collection; otherwise, -1.
Insert(int, Row)
Inserts the row at the specified index.
public void Insert(int index, Row row)
Parameters
Exceptions
- ArgumentNullException
If
rowisnull.- ArgumentOutOfRangeException
indexis not a valid index in the collection.
Remove(Row)
Removes the specified row.
public bool Remove(Row row)
Parameters
rowRowThe row to remove.
Returns
- bool
trueif the row was successfully removed from the collection; otherwise,false. This method also returnsfalseif the row is not found in the original collection.
RemoveAt(int)
Removes the row at the specified index.
public void RemoveAt(int index)
Parameters
indexintThe zero-based index of the row to remove.
Exceptions
- ArgumentOutOfRangeException
indexis not a valid index in the collection.- NotSupportedException
The collection is read-only.