/// <summary>Gets the section corresponding to the specified question/phrase.</summary> /// <param name="phrase">The phrase/question whose section is the be retrieved.</param> /// <exception cref="ArgumentException">An invalid phrase was supplied, which does /// not correspond to any section.</exception> /// <exception cref="T:System.InvalidOperationException">No section started with /// the given phrase's StartRef and yet more than one section contained it.</exception> public ISectionInfo Find(ITranslatablePhrase phrase) { var section = Find(phrase.PhraseKey.StartRef); if (section != null) { return(section); } section = GetSectionsThatContainRange(phrase.PhraseKey.StartRef, phrase.PhraseKey.EndRef) .SingleOrDefault().Value; if (section != null) { return(section); } throw new ArgumentException("An invalid phrase was supplied, which does not correspond to any section.", nameof(phrase)); }
/// -------------------------------------------------------------------------------- /// <summary> /// Initializes a new instance of the <see cref="XmlTranslation"/> class. /// </summary> /// -------------------------------------------------------------------------------- public XmlTranslation(ITranslatablePhrase tp) { Reference = tp.PhraseKey.ScriptureReference; PhraseKey = tp.PhraseKey.Text; Translation = tp.Translation; }