Caretaker.cs 397 B

1234567891011121314151617
  1. using System.Collections.Generic;
  2. namespace MementoPattern
  3. {
  4. /// <summary>
  5. /// 备忘录管理
  6. /// </summary>
  7. public class Caretaker
  8. {
  9. // 存储多个备份
  10. public Dictionary<string, ContactMemento> ContactMementoes { get; set; }
  11. public Caretaker()
  12. {
  13. ContactMementoes = new Dictionary<string, ContactMemento>();
  14. }
  15. }
  16. }