Exemplo n.º 1
0
        void writeNewNote(List <String> tags)
        {
            RealmConfigurationBase config = new RealmConfiguration("xnotes.1.realm");
            Realm realm = Realm.GetInstance(config);

            Model.Note note = new Model.Note(title, message, tags);
            note.tagLine = note.createTagLabel(tags);
            Console.WriteLine($"TAGLINE{note.tagLine}");
            realm.Write(() =>
            {
                realm.Add(note);
            });
        }
Exemplo n.º 2
0
        void preformRealmWrite(List <String> tags)
        {
            RealmConfigurationBase config = new RealmConfiguration("xnotes.1.realm");
            Realm realm = Realm.GetInstance(config);

            Model.Note note = new Model.Note(title, message, tags);
            note.tagLine = note.createTagLabel(tags);
            if (selectedNote == null)
            {
                realm.Write(() =>
                {
                    realm.Add(note);
                });
            }
            else
            {
                note.id = selectedNote.id;
                realm.Write(() =>
                {
                    realm.Add(note, update: true);
                });
            }
        }