摘要:
命令模式:将请求封装为对象,使得客户可以将不同的请求当做参数使用,同时可以支持Undo操作。示例代码:usingSystem;usingSystem.Text;usingSystem.IO;namespaceHello{//Interface CommandpublicinterfaceCommand{voidExecute();voidUndo();}//No CommandpublicclassNoCommand:Command{publicvoidExecute(){}publicvoidUndo(){}}//Light ClasspublicclassLight{publicvoidO 阅读全文