Class CellSpanInfoCollection<T>
A collection with elements derived from type CellSpanInfoBase. Internally this collection maintains both a List of CellSpanInfoBase and a so called pool. The pool allows immediate lookup of cell spans given a cells row and column index. The list allows looping through cell spans in the order they were added. CellSpanInfoCollection assumes that there is no overlap between cell spans. For any given cell there only at most one cell span must exist. CellSpanInfoCollection is a base class for the grids GridCoveredCellInfoCollection.
Implements
Inherited Members
Namespace: Syncfusion.Windows.Controls.Cells
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class CellSpanInfoCollection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, ISupportInitialize where T : CellSpanInfoBase
Type Parameters
| Name | Description |
|---|---|
| T | The element type of this collection. |
Constructors
CellSpanInfoCollection()
Declaration
public CellSpanInfoCollection()
Properties
Count
Gets the number of elements contained in the collection.
Declaration
public int Count { get; }
Property Value
| Type |
|---|
| System.Int32 |
IsEmpty
Gets a value indicating whether this collection is empty.
Declaration
public virtual bool IsEmpty { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsReadOnly
Gets a value indicating whether the collection is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type |
|---|
| System.Boolean |
Item[Int32]
Gets or sets the cell span at the specified index.
Declaration
public T this[int index] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
Property Value
| Type |
|---|
| T |
Methods
Add(T)
Adds an item to the collection. An exception is thrown if the cell range overlaps with another cell span in the collection.
Declaration
public void Add(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | The object to add to the collection. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException | The item is null. |
Added(T)
Declaration
protected virtual void Added(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item |
BeginInit()
Signals the object that initialization is starting.
Declaration
public void BeginInit()
CheckExistCellSpan(CellSpanInfoBase)
Checks if the cell span exists.
Declaration
public bool CheckExistCellSpan(CellSpanInfoBase span)
Parameters
| Type | Name | Description |
|---|---|---|
| CellSpanInfoBase | span | The cell span. |
Returns
| Type |
|---|
| System.Boolean |
Clear()
Removes all items from the collection.
Declaration
public void Clear()
Contains(T)
Determines whether the collection contains a specific value.
Declaration
public bool Contains(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | The object to locate in the collection. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if |
CopyTo(T[], Int32)
Copies the elements of the collection to an System.Array, starting at a particular System.Array index.
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | array | The one-dimensional System.Array that is the destination of the elements copied from collection. The System.Array must have zero-based indexing. |
| System.Int32 | arrayIndex | The zero-based index in |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentNullException |
|
| System.ArgumentOutOfRangeException |
|
| System.ArgumentException |
|
EndInit()
Signals the object that initialization is complete.
Declaration
public void EndInit()
GetCellSpan(Int32, Int32)
Gets the cell span.
Declaration
public T GetCellSpan(int rowIndex, int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Index of the row. |
| System.Int32 | columnIndex | Index of the column. |
Returns
| Type | Description |
|---|---|
| T | The cell span if found; othwerwise null if there is no cell span for the specified row and column. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerator<T> | A enumerator that can be used to iterate through the collection. |
IndexOf(T)
Determines the index of a specific item in the collection.
Declaration
public int IndexOf(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | The object to locate in the collection. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The index of |
Insert(Int32, T)
Inserts an item to the collection at the specified index. An exception is thrown if the cell range overlaps with another cell span in the collection.
Declaration
public virtual void Insert(int index, T item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The zero-based index at which |
| T | item | The object to insert into the collection. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException |
|
| System.ArgumentNullException | The item is null. |
InsertColumns(Int32, Int32)
Inserts the columns.
Declaration
public void InsertColumns(int insertAtColumnIndex, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | insertAtColumnIndex | Index of the insert at column. |
| System.Int32 | count | The count. |
InsertColumns(Int32, Int32, CellSpanInfoCollection<T>)
Inserts the columns.
Declaration
public void InsertColumns(int insertAtColumnIndex, int count, CellSpanInfoCollection<T> moveCellsState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | insertAtColumnIndex | Index of the insert at column. |
| System.Int32 | count | The count. |
| CellSpanInfoCollection<T> | moveCellsState | State of the move cells. |
InsertRows(Int32, Int32)
Inserts the rows.
Declaration
public void InsertRows(int insertAtRowIndex, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | insertAtRowIndex | Index of the insert at row. |
| System.Int32 | count | The count. |
InsertRows(Int32, Int32, CellSpanInfoCollection<T>)
Inserts the rows.
Declaration
public void InsertRows(int insertAtRowIndex, int count, CellSpanInfoCollection<T> moveCellsState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | insertAtRowIndex | Index of the insert at row. |
| System.Int32 | count | The count. |
| CellSpanInfoCollection<T> | moveCellsState | State of the move cells. |
OnGetCellSpan(Int32, Int32, out T)
This virtual method is called form GetCellSpan(Int32, Int32). Override this method to return a custom cell span that include the specified cells row and column index. In such case you should also return true.
Declaration
protected virtual bool OnGetCellSpan(int rowIndex, int columnIndex, out T result)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Index of the row. |
| System.Int32 | columnIndex | Index of the column. |
| T | result | The result cell span. |
Returns
| Type |
|---|
| System.Boolean |
Remove(T)
Removes the first occurrence of a specific object from the collection.
Declaration
public bool Remove(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | The object to remove from the collection. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if |
RemoveAt(Int32)
Removes the collection item at the specified index.
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | The zero-based index of the item to remove. |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException |
|
| System.NotSupportedException | The collection is read-only. |
RemoveColumns(Int32, Int32)
Removes the columns.
Declaration
public void RemoveColumns(int removeAtColumnIndex, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | removeAtColumnIndex | Index of the remove at column. |
| System.Int32 | count | The count. |
RemoveColumns(Int32, Int32, CellSpanInfoCollection<T>)
Removes the columns.
Declaration
public void RemoveColumns(int removeAtColumnIndex, int count, CellSpanInfoCollection<T> moveCellsState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | removeAtColumnIndex | Index of the remove at column. |
| System.Int32 | count | The count. |
| CellSpanInfoCollection<T> | moveCellsState | State of the move cells. |
Removed(T)
Declaration
protected virtual void Removed(T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item |
RemoveRows(Int32, Int32)
Removes the rows.
Declaration
public void RemoveRows(int removeAtRowIndex, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | removeAtRowIndex | Index of the remove at row. |
| System.Int32 | count | The count. |
RemoveRows(Int32, Int32, CellSpanInfoCollection<T>)
Removes the rows.
Declaration
public void RemoveRows(int removeAtRowIndex, int count, CellSpanInfoCollection<T> moveCellsState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | removeAtRowIndex | Index of the remove at row. |
| System.Int32 | count | The count. |
| CellSpanInfoCollection<T> | moveCellsState | State of the move cells. |
ResetCache()
Resets the cached information for last found cell span.
Declaration
public void ResetCache()
ResetCellSpan(CellSpanInfoBase)
Resets the cell span and removes it from the collection.
Declaration
public void ResetCellSpan(CellSpanInfoBase cci)
Parameters
| Type | Name | Description |
|---|---|---|
| CellSpanInfoBase | cci | The cci. |
ResetCellSpan(Int32, Int32)
Resets the cell span and removes it from the collection.
Declaration
public void ResetCellSpan(int rowIndex, int columnIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | rowIndex | Index of the row. |
| System.Int32 | columnIndex | Index of the column. |
SearchCellSpan(CellSpanInfoBase)
Searches the cell span.
Declaration
public List<T> SearchCellSpan(CellSpanInfoBase span)
Parameters
| Type | Name | Description |
|---|---|---|
| CellSpanInfoBase | span | The cell span. |
Returns
| Type |
|---|
| System.Collections.Generic.List<T> |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
| Type |
|---|
| System.Collections.IEnumerator |