public NoteEntity(Note note, string notePath, string notebookName, string notebookPath) : this() { if (null == note) { throw new ArgumentNullException("note"); } if (null == notebookName) { throw new ArgumentNullException("notebookName"); } NotePath = notePath; Title = note.Title; CreateTime = note.CreateTime; ModifyTime = note.ModifyTime; Size = note.Size; Source = note.Source; NotebookPath = notebookPath; Content = note.Content; Author = note.Author; NotebookName = notebookName; NoteStatus = NoteStatus.Normal; }
private NoteEntity modifyNote(NoteSync noteSync, Note serverNote, NoteEntity findLocalNote, Dictionary<NoteBatchOperateEnum, List<NoteEntity>> dic = null) { findLocalNote.NotePath = noteSync.NotePath; findLocalNote.Title = serverNote.Title; findLocalNote.CreateTime = serverNote.CreateTime; findLocalNote.ModifyTime = serverNote.ModifyTime; findLocalNote.Size = serverNote.Size; findLocalNote.Source = serverNote.Source; findLocalNote.NotebookPath = noteSync.NotebookPath; findLocalNote.Content = DownloadImageToLocalAsync(noteSync.NotePath, serverNote.Content).Result; findLocalNote.Author = serverNote.Author; findLocalNote.NotebookName = noteSync.NotebookName; findLocalNote.NoteStatus = NoteStatus.Normal; if (null == dic) { NoteDao.Inst.ModifyIfExist(findLocalNote); } else { if (null != findLocalNote) { dic[NoteBatchOperateEnum.Modify].Add(findLocalNote); } } return findLocalNote; }