public PresenterFolder.ReferenceList searchPhrase(string phrase)
 {
     List<data_index.Verse> verses = Bible.Index.GetVerses(phrase);
     PresenterFolder.ReferenceList newList = new PresenterFolder.ReferenceList();
     if (verses != null)
     {
         foreach (data_index.Verse item in verses)
         {
             newList.AddReference(item.Book, item.Chapter, item.VerseNumber);
         }
     }
     else
     {
         newList = null;
     }
     return newList;
 }
Beispiel #2
0
        private void foundWholeBookName(ref string lastFoundBook, ref string[] text, 
            ref int i, ref List<string> suggestionList,  ref IMainWindow _view,
            ref string originalSearch, ref ReferenceList refList)
        {
            lastFoundBook = text[i].CapitalizeWord();
            if (i < text.Count() - 1) //something after book
            {

            }
            else // nothing after book
            {
                // return a list of possible chapters for the book
                suggestionList = _index.GetPossibleChapters(lastFoundBook).AddPrefixToList(originalSearch + " ");
                _view.SearchBoxSuggestions(suggestionList, originalSearch);
            }

            // save book reference
            if (refList.CurrentReference == null || refList.CurrentReference.Range == false)
            {
                refList.AddReference(lastFoundBook);
            }
            else // if expecting another book reference
            {
                refList.CurrentReference.EndBook = lastFoundBook;
                refList.AddReference(null);
            }

            //foundBook(text, originalSearch);
        }