Imports UTS_Core.UTSModule.Station

Public Class GridNodeTextChangedCommand : Implements ICommand

    Private ReadOnly grd As StationPlanGrid
    Private ReadOnly dic As Dictionary(Of Integer, TextChangedRowNode)

    Sub New(grd As StationPlanGrid, dic As Dictionary(Of Integer, TextChangedRowNode))
        Me.grd = grd
        Me.dic = dic
    End Sub

    Public Sub Redo() Implements ICommand.Redo
        For Each row As Integer In dic.Keys
            grd.UpdateGrid2(dic(row).AfterRowNode)
        Next

    End Sub

    Public Sub Undo() Implements ICommand.Undo

        For Each row As Integer In dic.Keys
            grd.UpdateGrid2(dic(row).BeforeRowNode)
        Next

    End Sub
End Class

Public Class TextChangedRowNode

    Public Property BeforeRowNode As RowNode

    Public Property AfterRowNode As RowNode

End Class
