📄 undocommand.vb
字号:
Imports System
Imports System.ComponentModel
Imports System.Drawing
Imports System.WinForms
Imports System.Collections
Public Class UndoCommand
Implements Command
Private undoList As ArrayList
Public Sub New()
MyBase.New
undoList = New ArrayList
End Sub
Public Sub add(cmd As Command)
If Not (cmd.IsUndo) Then
undoList.add (cmd)
End If
End Sub
Public Sub Execute Implements Command.Execute
Dim Index As Integer
Dim cmd As Command
Index = undoList.Count-1
If Index >= 0 Then
cmd = Ctype(undoList(Index), COmmand)
cmd.Undo
undoList.RemoveAt( Index)
End If
End Sub
public function isUndo as Boolean Implements Command.IsUndo
return true
end function
Private Sub Undo Implements Command.Undo
'do nothing
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -