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.Forms.CellGrid
Assembly: Syncfusion.Spreadsheet.Windows.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 virtual void Clear()
CollectionModified(List<T>)
Declaration
protected virtual void CollectionModified(List<T> spanCollection)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<T> | spanCollection |
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()
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. |
OnGetCellSpan(Int32, Int32, out T)
This virtual method is called form Syncfusion.Windows.Forms.CellGrid.CellSpanInfoCollection`1.GetCellSpan(System.Int32,System.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. |
Removed(T)
Declaration
protected virtual void Removed(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
---|
System.Collections.IEnumerator |