Skip to content

Commit

Permalink
Reformat format of FsAddress for readability/findability
Browse files Browse the repository at this point in the history
  • Loading branch information
omaus committed Mar 10, 2023
1 parent 153c485 commit 910117a
Showing 1 changed file with 27 additions and 14 deletions.
41 changes: 27 additions & 14 deletions src/FsSpreadsheet/FsAddress.fs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ type FsAddress(rowNumber : int, columnNumber : int, fixedRow : bool, fixedColumn

let mutable _trimmedAddress = ""

// ----------------------
// ALTERNATE CONSTRUCTORS
// ----------------------

new (rowNumber : int, columnLetter : string, fixedRow : bool, fixedColumn : bool) =
FsAddress(rowNumber,CellReference.colAdressToIndex columnLetter |> int,fixedRow,fixedColumn)

Expand All @@ -91,9 +95,19 @@ type FsAddress(rowNumber : int, columnNumber : int, fixedRow : bool, fixedColumn
new (cellAddressString : string) =
let colIndex,rowIndex = CellReference.toIndices cellAddressString
FsAddress(int rowIndex,int colIndex)


// ----------
// PROPERTIES
// ----------

member this.LOL () = 1
//let mutable _address = address
member self.ColumnNumber
with get() = _columnNumber
and set(colI) = _columnNumber <- colI

member self.RowNumber
with get() = _rowNumber
and set(rowI) = _rowNumber <- rowI

member self.Address
with get() = CellReference.ofIndices (uint32 _columnNumber) (uint32 _rowNumber)
Expand All @@ -102,19 +116,18 @@ type FsAddress(rowNumber : int, columnNumber : int, fixedRow : bool, fixedColumn
_rowNumber <- int row
_columnNumber <- int column

member self.OfIndices(rowIndex,colIndex) =
_columnNumber <- colIndex
_rowNumber <- rowIndex
member self.FixedRow = false
member self.FixedColumn = false

member self.ToIndices() = _rowNumber,_columnNumber

member self.ColumnNumber
with get() = _columnNumber
and set(colI) = _columnNumber <- colI
// -------
// METHODS
// -------

member self.RowNumber
with get() = _rowNumber
and set(rowI) = _rowNumber <- rowI
member this.LOL () = 1
//let mutable _address = address

member self.FixedRow = false
member self.FixedColumn = false
/// <summary>Updates the row- and columnIndex respective to the given indices.</summary>
member self.OfIndices(rowIndex,colIndex) =
_columnNumber <- colIndex
_rowNumber <- rowIndex

0 comments on commit 910117a

Please sign in to comment.