ContactMemento.cs 578 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace MementoPattern
  7. {
  8. /// <summary>
  9. /// 备忘录
  10. /// </summary>
  11. public class ContactMemento
  12. {
  13. private readonly List<ContactPerson> _backupContactPersons;
  14. public List<ContactPerson> GetMemento()
  15. {
  16. return _backupContactPersons;
  17. }
  18. public ContactMemento(List<ContactPerson> backupContactPersons)
  19. {
  20. _backupContactPersons = backupContactPersons;
  21. }
  22. }
  23. }