public virtual Note Add(string title, string body) { var note = new Note(++counter, title, body); notes.Add(note.Id, note); SaveNotes(); return note; }
public override bool Remove(Note note) { var res = base.Remove(note); if (res) { NetworkHandler.SyncNotes(new NotesList(note), NotesSyncType.RemoveNotes); if (NotesDeleted != null) NotesDeleted(new List<Note>() { note }); } return res; }
public NotesList(Note note) : this() { notes.Add(note.Id, note); }
protected virtual void SolveIdConflictWhenAddNewNote(Note n) { var original = GetNote(n.Id); if (original.NoteText != n.NoteText || original.Title != n.Title) { Add(original.Title, original.NoteText); original.Title = n.Title; original.NoteText = n.NoteText; SaveNotes(); } }
public virtual bool Remove(Note note) { var res = notes.Remove(note.Id); if (res) SaveNotes(); return res; }
public Note(Note original) { Id = original.Id; Title = original.title; NoteText = original.NoteText; }