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

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

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

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