Skip to content

Commit

Permalink
Format FsRow.fs
Browse files Browse the repository at this point in the history
  • Loading branch information
omaus committed Mar 2, 2023
1 parent dc4fe4b commit fd6fe47
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/FsSpreadsheet/FsRow.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ type FsRow (rangeAddress : FsRangeAddress, cells : FsCellsCollection, styleValue

new (index,cells) = FsRow (FsRangeAddress(FsAddress(index,1),FsAddress(index,1)),cells,null)

member self.Cell(columnIndex) = base.Cell(FsAddress(1,columnIndex),cells)

// ------------------
// NON-STATIC METHODS
// ------------------

/// Returns the FsCell at columnIndex.
member self.Cell(columnIndex) =
base.Cell(FsAddress(1,columnIndex),cells)

//match _cells |> List.tryFind (fun cell -> cell.WorksheetColumn = columnIndex) with
//| Some cell ->
Expand All @@ -23,11 +30,14 @@ type FsRow (rangeAddress : FsRangeAddress, cells : FsCellsCollection, styleValue
// _cells <- List.append _cells [cell]
// cell

/// Inserts the value at columnIndex as an FsCell. If there is an FsCell at the position, this FsCells and all the ones right to it are shifted to the right.
member this.InsertValueAt(colIndex, (value : 'a)) =
let cell = FsCell(value)
cells.Add(int32 this.Index, int32 colIndex, cell)

member self.Cells = base.Cells(cells)
/// Returns all FsCells.
member self.Cells =
base.Cells(cells)

/// The index of the FsRow.
member self.Index
Expand All @@ -38,11 +48,16 @@ type FsRow (rangeAddress : FsRangeAddress, cells : FsCellsCollection, styleValue

//member self.SortCells() = _cells <- _cells |> List.sortBy (fun c -> c.WorksheetColumn)


// --------------
// STATIC METHODS
// --------------

/// Returns the index of the given FsRow.
static member getIndex (row : FsRow) =
row.Index

/// Add a value at the given row- and columnindex to FsRow using.
/// Adds a value at the given row- and columnIndex to FsRow using.
///
/// If a cell exists in the given position, shoves it to the right.
static member insertValueAt colIndex value (row : FsRow) =
Expand Down

0 comments on commit fd6fe47

Please sign in to comment.