/// <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); }
/// <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); }
/// <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)); }
/// <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; }