/// <summary> /// 恢复联系人 /// </summary> public void RecoveryMemorandum(ContactMemorandum memorandum) { //这里一定要使用深拷贝,否则会引用对象的传递,备份就无效 this.ContactList = CoreService.CloneData(memorandum.ContactList); }
/// <summary> /// 备份联系人 /// </summary> public ContactMemorandum CreateMemorandum(string name) { //这里一定要使用深拷贝,否则会引用对象的传递,备份就无效 return(new ContactMemorandum(name, CoreService.CloneData(this.ContactList))); }