?? undocomd.cs
字號(hào):
using System;
using System.Drawing ;
using System.Windows.Forms;
using System.Collections ;
namespace UndoCommand
{
/// <summary>
/// Summary description for UndoCommand.
/// </summary>
public class UndoComd:Command {
private ArrayList undoList;
public UndoComd() {
undoList = new ArrayList ();
}
//-----
public void add(Command comd) {
if(! comd.isUndo ()) {
undoList.Add (comd);
}
}
//-----
public bool isUndo() {
return true;
}
//-----
public void Undo() { }
//-----
public void Execute() {
int index = undoList.Count - 1;
if (index >= 0) {
Command cmd = (Command)undoList[index];
cmd.Undo();
undoList.RemoveAt(index);
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -