设计模式学习笔记--备忘录模式
2016-05-29 07:06
357 查看
namespace Memento { class Program { static void Main(string[] args) { Originator originator = new Originator(); originator.State = "On"; originator.Show(); Caretaker caretaker = new Caretaker(); caretaker.Memento = originator.CreateMemento(); originator.State = "Off"; originator.Show(); originator.SetMemento(caretaker.Memento); originator.Show(); } } }
View Code
相关文章推荐
- POJ3982 序列
- method to The entitlements specified in your application’s Code Signing Entitlements file do not mat
- 如何判断是否安装了VC RUNTIME
- 使用JavaScript判断用户是否为手机设备
- c 字符串分割函数
- jquery zclip 复制插件的使用
- log4cxx
- WebCollector 2.x 教程列表
- HDU1297 Children’s Queue
- 安卓手机上的python运行环境-qpython
- 自旋锁的故事
- 微软亚洲研究院比赛记:hackathon! MPC,Fight!
- JAVA_面向对象2
- 单例设计模式
- leetcode #50 in cpp
- mybatis枚举自动转换(通用转换处理器实现)
- mybatis枚举自动转换实现
- 一句话理解数据库索引
- 如何安装和使用Alcatraz
- leetcode #49 in cpp