Ejemplo n.º 1
0
        /// <summary>
        /// Adds the pronunciation to the list.  If it already exists,
        /// it is replaced.
        /// </summary>
        /// <param name="pronunciation">the pronunciation object</param>
        /// <returns>true on success</returns>
        public bool Add(Pronunciation pronunciation)
        {
            if (String.IsNullOrEmpty(pronunciation.Word) ||
                String.IsNullOrWhiteSpace(pronunciation.Word) ||
                String.IsNullOrWhiteSpace(pronunciation.AltPronunciation) ||
                String.IsNullOrEmpty(pronunciation.AltPronunciation))
            {
                return(false);
            }

            _pronunciationList[pronunciation.Word] = pronunciation;
            return(true);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Replaces the old pronunciation with a new one.
 /// </summary>
 /// <param name="word">word to look for</param>
 /// <param name="pronunciation">new pronunciation object</param>
 /// <returns></returns>
 public bool Update(String word, Pronunciation pronunciation)
 {
     Remove(word);
     return Add(pronunciation);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Replaces the old pronunciation with a new one.
 /// </summary>
 /// <param name="word">word to look for</param>
 /// <param name="pronunciation">new pronunciation object</param>
 /// <returns></returns>
 public bool Update(String word, Pronunciation pronunciation)
 {
     Remove(word);
     return(Add(pronunciation));
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds the pronunciation to the list.  If it already exists,
        /// it is replaced.
        /// </summary>
        /// <param name="pronunciation">the pronunciation object</param>
        /// <returns>true on success</returns>
        public bool Add(Pronunciation pronunciation)
        {
            if (String.IsNullOrEmpty(pronunciation.Word) ||
                String.IsNullOrWhiteSpace(pronunciation.Word) ||
                String.IsNullOrWhiteSpace(pronunciation.AltPronunciation) ||
                String.IsNullOrEmpty(pronunciation.AltPronunciation))
            {
                return false;
            }

            _pronunciationList[pronunciation.Word] = pronunciation;
            return true;
        }