Skip to content

Commit

Permalink
Add method to more easily add FsCells
Browse files Browse the repository at this point in the history
  • Loading branch information
omaus committed Mar 8, 2023
1 parent ef97805 commit 0abafea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/FsSpreadsheet/Cells/FsCellsCollection.fs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ type FsCellsCollection() =
// Add(sheetPoint.Row, sheetPoint.Column, cell);
//}

/// Adds an FsCell of given rowIndex and columnIndex to the FsCellsCollection.
/// <summary>Adds an FsCell of given rowIndex and columnIndex to the FsCellsCollection.</summary>
member this.Add(row : int32, column : int32, cell : FsCell) =

_count <- _count + 1
Expand Down Expand Up @@ -122,6 +122,11 @@ type FsCellsCollection() =
static member add rowIndex colIndex (cell : FsCell) (cellsCollection : FsCellsCollection) =
cellsCollection.Add(rowIndex, colIndex, cell)

/// <summary>Adds an FsCell to the FsCellsCollection.</summary>
/// <remarks>Derives row- and columnIndex from the FsAddress of the FsCell.</remarks>
member self.Add(cell : FsCell) =
self.Add(cell.Address.RowNumber, cell.Address.ColumnNumber, cell)

/// <summary>Checks if an FsCell exists at given row- and columnIndex.</summary>
member this.ContainsCellAt(rowIndex, colIndex) =
match Dictionary.tryGet rowIndex _rowsCollection with
Expand Down

0 comments on commit 0abafea

Please sign in to comment.