void LoadData() { var fromSaved = NoteStorage.Instance.ItemByGuid(_guid); _noteData = new NoteData(_guid) { text = fromSaved.text, color = fromSaved.color }; }
void Init() { if (NoteStorage.Instance.HasItem(_guid)) { LoadData(); } else { _noteData = new NoteData(_guid); } }
public void AddOrUpdate(NoteData entry) { var serObj = AsSerializedObj; if (HasItem(entry.guid)) { UpdateNote(entry); } else { AddNote(entry); } Persist(serObj); }
void AddNote(NoteData entry) { _cache.Add(entry.guid, entry); _notes.Add(entry); }
public NoteData(NoteData other) { guid = other.guid; color = other.color; text = other.text; }