You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB
C#

9 months ago
namespace com.azkoss.excellite
{
using System;
using System.Reflection;
///<summary>
///Collection of excel cells (<see cref="com.azkoss.excellite.ExcelCell">ExcelCell</see>).
///</summary>
///<seealso cref="com.azkoss.excellite.ExcelCell" />
public class ExcelCellCollection : ExcelRowColumnCellCollectionBase
{
// Methods
internal ExcelCellCollection(ExcelWorksheet parent) : base(parent)
{
}
internal ExcelCellCollection(ExcelWorksheet parent, ExcelCellCollection sourceCells) : base(parent)
{
foreach (ExcelCell cell1 in sourceCells)
{
base.Items.Add(new ExcelCell(base.Parent, cell1));
}
}
private void AdjustArraySize(int index)
{
if (index > (base.Items.Count - 1))
{
ExcelColumnCollection.ExceptionIfColumnOutOfRange(index);
int num2 = index - (base.Items.Count - 1);
for (int num1 = 0; num1 < num2; num1++)
{
base.Items.Add(new ExcelCell(base.Parent));
}
}
}
// Properties
///<summary>
///Gets the cell with the specified index.
///</summary>
///<param name="index">The zero-based index of the cell.</param>
public ExcelCell this[int index]
{
get
{
this.AdjustArraySize(index);
return (ExcelCell) base.Items[index];
}
}
}
}