Beispiel #1
0
 /// <summary>
 /// Call this to just bubble a history item to the top
 /// </summary>
 /// <param name="hi"></param>
 public void BubbleToTop(Phrase hi)
 {
     if (Phrases.Count > 1)
     {
         int index = Phrases.IndexOf(hi);
         if (index != -1)
         {
             Phrase temp = Phrases[index];
             Phrases.RemoveAt(index);
             Phrases.Insert(0, temp);
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Adds a single translation which consists of the phrase and the langauge
 /// </summary>
 /// <param name="fromString">The text</param>
 /// <param name="fromLanguage">The Language</param>
 /// <returns>The Phrase which contains the translation</returns>
 private Phrase AddSingleTranslation(string fromString, string fromLanguage)
 {
     Phrase phrase = FindPhrase(fromString, fromLanguage);
     if (phrase == null)
     {
         phrase = new Phrase();
         Phrases.Add(phrase);
     }
     phrase.AddTranslation(fromString, fromLanguage);
     return phrase;
 }
Beispiel #3
0
 /// <summary>
 /// When the History Picker page selects something, this will bubble it to the top
 /// and set the dirty bit so that the main page can reflect the changes.
 /// </summary>
 /// <param name="hi"></param>
 public void ChooseFromHistory(Phrase phrase)
 {
     HistoryList.BubbleToTop(phrase);
 }