Table of Contents

Class ColumnCollection

Namespace
Ranorex.Core.Data
Assembly
Ranorex.Core.dll

Represents a collection of Column instances.

public sealed class ColumnCollection : IList<Column>, ICollection<Column>, IEnumerable<Column>, IEnumerable
Inheritance
ColumnCollection
Implements
Inherited Members
Extension Methods

Constructors

ColumnCollection()

Initializes a new instance.

public ColumnCollection()

Remarks

Create a new empty collection that is not readonly.

Properties

Count

Gets the number of elements contained in the collection.

public int Count { get; }

Property Value

int

The number of elements contained in the collection.

IsReadOnly

Gets a value indicating whether the collection is read-only.

public bool IsReadOnly { get; }

Property Value

bool

true if the collection is read-only; otherwise, false.

this[int]

Gets or sets the Column at the specified index.

public Column this[int index] { get; set; }

Parameters

index int

The zero-based index of the ColumnHeader to get or set.

Property Value

Column

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the collection.

NotSupportedException

The property is set and the collection is read-only.

this[string]

Gets the Column with the specified ColumnHeader name.

public Column this[string columnName] { get; }

Parameters

columnName string

The name of the ColumnHeader to get.

Property Value

Column

Exceptions

KeyNotFoundException

If this collection does not contain a ColumnHeader with the specified name.

Methods

Add(Column)

Adds the specified ColumnHeader to this collection.

public void Add(Column column)

Parameters

column Column

The ColumnHeader to add.

Exceptions

NotSupportedException

The collection is read-only.

Clear()

Removes all items from the collection.

public void Clear()

Exceptions

NotSupportedException

The collection is read-only.

Contains(Column)

Determines whether the collection contains the specified ColumnHeader.

public bool Contains(Column item)

Parameters

item Column

The ColumnHeader to locate in the collection.

Returns

bool

true if item is found in the collection; otherwise, false.

Contains(string)

Determines whether this collection contains a Column with the specified columnName.

public bool Contains(string columnName)

Parameters

columnName string

Name of the column.

Returns

bool
<code>true</code> if this collection contains a <xref href="Ranorex.Column" data-throw-if-not-resolved="false"></xref> with

the specified columnName; otherwise, false.

CopyTo(Column[], int)

Copies the elements of the collection to an Array, starting at a particular Array index.

public void CopyTo(Column[] array, int arrayIndex)

Parameters

array Column[]

The one-dimensional Array that is the destination of the elements copied from the collection. The Array must have zero-based indexing.

arrayIndex int

The zero-based index in array at which copying begins.

Exceptions

ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

ArgumentException
<code class="paramref">array</code> is multidimensional.

-or- arrayIndex is equal to or greater than the length of array. -or- The number of elements in the source collection is greater than the available space from arrayIndex to the end of the destination array.

CreateCopy()

Creates a deep copy of this collection.

public ColumnCollection CreateCopy()

Returns

ColumnCollection

A new ColumnHeader collection containing columns with the same name as the columns in this collection.

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<Column> GetEnumerator()

Returns

IEnumerator<Column>

An enumerator that can be used to iterate through the collection.

IndexOf(Column)

Determines the index of a specific ColumnHeader in the collection.

public int IndexOf(Column item)

Parameters

item Column

The ColumnHeader to locate in the collection.

Returns

int

The index of item if found in the list; otherwise, -1.

IndexOf(string)

Determines the index of the ColumnHeader with the specified columnName within this collection.

public int IndexOf(string columnName)

Parameters

columnName string

The name of the ColumnHeader to get the index of.

Returns

int

The index of the ColumnHeader with the specified columnName if found in this collection; otherwise, -1.

Insert(int, Column)

Inserts a column at the specified index.

public void Insert(int index, Column column)

Parameters

index int

The zero-based index at which the column should be inserted.

column Column

The column to insert into the collection.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the collection.

NotSupportedException

The collection is read-only.

MakeReadOnly()

Makes this collection read only.

public void MakeReadOnly()

Remarks

This operation is irreversible.

Remove(Column)

Removes the first occurrence of the specified column.

public bool Remove(Column column)

Parameters

column Column

The ColumnHeader to remove from the collection.

Returns

bool

true if the ColumnHeader was successfully removed from the collection; otherwise, false. This method also returns false if the ColumnHeader is not found in the original collection.

Exceptions

NotSupportedException

The collection is read-only.

RemoveAt(int)

Removes the ColumnHeader at the specified index.

public void RemoveAt(int index)

Parameters

index int

The zero-based index of the ColumnHeader to remove.

Exceptions

ArgumentOutOfRangeException

index is not a valid index in the collection.

NotSupportedException

The collection is read-only.