批量粘贴与批量撤销功能上线

This commit is contained in:
2025-05-15 11:12:31 +08:00
parent 88c4699a48
commit 841c866cd8
7 changed files with 401 additions and 219 deletions

View File

@@ -1,24 +1,35 @@
Public Class GridNodeTextChangedCommand : Implements ICommand
Imports UTS_Core.UTSModule.Station
Private ReadOnly grd As FlexCell.Grid
Private ReadOnly row As Integer
Private ReadOnly col As Integer
Private ReadOnly beforeText As String
Private ReadOnly afterText As String
Public Class GridNodeTextChangedCommand : Implements ICommand
Sub New(grd As FlexCell.Grid, row As Integer, col As Integer, beforeText As String, afterText As String)
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.row = row
Me.col = col
Me.beforeText = beforeText
Me.afterText = afterText
Me.dic = dic
End Sub
Public Sub Redo() Implements ICommand.Redo
grd.Cell(row, col).Text = afterText
For Each row As Integer In dic.Keys
grd.UpdateGrid2(dic(row).AfterRowNode)
Next
End Sub
Public Sub Undo() Implements ICommand.Undo
grd.Cell(row, col).Text = beforeText
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