Example #1
0
        void LoadData()
        {
            var fromSaved = NoteStorage.Instance.ItemByGuid(_guid);

            _noteData = new NoteData(_guid)
            {
                text  = fromSaved.text,
                color = fromSaved.color
            };
        }
Example #2
0
 void Init()
 {
     if (NoteStorage.Instance.HasItem(_guid))
     {
         LoadData();
     }
     else
     {
         _noteData = new NoteData(_guid);
     }
 }
Example #3
0
        public void AddOrUpdate(NoteData entry)
        {
            var serObj = AsSerializedObj;

            if (HasItem(entry.guid))
            {
                UpdateNote(entry);
            }
            else
            {
                AddNote(entry);
            }

            Persist(serObj);
        }
Example #4
0
 void AddNote(NoteData entry)
 {
     _cache.Add(entry.guid, entry);
     _notes.Add(entry);
 }
Example #5
0
 public NoteData(NoteData other)
 {
     guid  = other.guid;
     color = other.color;
     text  = other.text;
 }