Example #1
0
        private void NotesListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
        {
            note           selectedNote = notesList[e.Position];
            IList <string> noteExtra    = new List <string>();

            noteExtra.Add(selectedNote.Title);
            noteExtra.Add(selectedNote.Id.ToString());
            var intent = new Intent(this, typeof(NodeActivity));

            intent.PutStringArrayListExtra("Title and ID", noteExtra);
            StartActivity(intent);
        }
Example #2
0
        public static int GetNumChildren(note parent)
        {
            int children = 0;

            foreach (note n in conn.Table <note>().ToList())
            {
                if (n.ParentId == parent.Id)
                {
                    children++;
                }
            }
            return(children);
        }
Example #3
0
        public static void DeleteRecursive(string title)
        {
            note        target    = GetNoteFromTitle(title);
            List <note> notesList = GetAllNotes();

            foreach (note n in notesList.ToArray())
            {
                if (n.ParentId == target.Id)
                {
                    DeleteRecursive(n.Title);
                }
            }
            DeleteNote(title);
        }
Example #4
0
        public static note GetNoteFromTitle(string title)
        {
            note note = conn.Table <note>().Where(x => x.Title == title).FirstOrDefault();

            return(note);
        }