Imports FlexCell

Public Class GridNavigation : Implements INavigation

    Private ReadOnly _grd As Grid
    Private ReadOnly _beforeRange As GridSelectRange
    Private ReadOnly _afterRange As GridSelectRange

    Sub New(grd As FlexCell.Grid, beforeRange As GridSelectRange, afterRange As GridSelectRange)
        _grd = grd
        Me._beforeRange = beforeRange
        Me._afterRange = afterRange
    End Sub


    Public Sub Backward() Implements INavigation.Backward
        _grd.Range(_beforeRange.StartRow, _beforeRange.StartCol, _beforeRange.EndRow, _beforeRange.EndCol).SelectCells()
    End Sub

    Public Sub Forward() Implements INavigation.Forward
        _grd.Range(_afterRange.StartRow, _afterRange.StartCol, _afterRange.EndRow, _afterRange.EndCol).SelectCells()
    End Sub

End Class


Public Class GridSelectRange
    Public Property StartRow As Integer
    Public Property StartCol As Integer

    Public Property EndRow As Integer

    Public Property EndCol As Integer


End Class