예제 #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ScrReferenceFilterDlg"/> class.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 internal ScrReferenceFilterDlg(IScrVers versification, BCVRef initialFromRef, BCVRef initialToRef,
                                int[] canonicalBookIds)
 {
     InitializeComponent();
     scrPsgFrom.Initialize(new BCVRef(initialFromRef), versification, canonicalBookIds);
     scrPsgTo.Initialize(new BCVRef(initialToRef), versification, canonicalBookIds);
     m_firstAvailableRef        = new BCVRef(canonicalBookIds[0], 1, 1);
     m_lastAvailableRef         = new BCVRef(canonicalBookIds.Last(), 1, 1);
     m_lastAvailableRef.Chapter = versification.GetLastChapter(m_lastAvailableRef.Book);
     m_lastAvailableRef.Verse   = versification.GetLastVerse(m_lastAvailableRef.Book, m_lastAvailableRef.Chapter);
     if (initialFromRef == m_firstAvailableRef && initialToRef == m_lastAvailableRef)
     {
         btnClearFilter.Enabled = false;
     }
 }
예제 #2
0
 public int GetLastChapter(int bookNum)
 {
     return(m_vers.GetLastChapter(bookNum));
 }
예제 #3
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Determines if the reference is valid for the given versification.
 /// </summary>
 /// ------------------------------------------------------------------------------------
 public virtual bool IsValidInVersification(IScrVers versification)
 {
     return Valid && (versification.GetLastChapter(Book) >= Chapter &&
         versification.GetLastVerse(Book, Chapter) >= Verse);
 }