Beispiel #1
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Returns true if the given reference is recognized as that of an introduction section.
 /// (provides a static equivalent of this.IsIntro).
 /// </summary>
 /// <param name="cache">The FDO cache.</param>
 /// <param name="hvoSection">The hvo of the section.</param>
 /// <remarks>
 /// This method exists strictly as a performance enhancement and can be replaced by a
 /// direct call to IsIntro when the cache is ported and it is inexpensive to access the
 /// real ScrSection object.
 /// We come here a lot (gets called from Update handler), so we don't want to construct
 /// a ScrSection object here but get the value we're interested in directly from the
 /// cache. Creating a ScrSection object checks if the HVO is valid. In doing so it does
 /// a query on the database (select Class$ from CmObject...) This happens only in Debug,
 /// but getting the interesting value directly from the cache makes it easier to do SQL
 /// profiling.
 /// </remarks>
 /// ------------------------------------------------------------------------------------
 public static bool IsIntroSection(FdoCache cache, int hvoSection)
 {
     return(BCVRef.GetVerseFromBcv(cache.GetIntProperty(hvoSection,
                                                        (int)ScrSection.ScrSectionTags.kflidVerseRefEnd)) == 0);
 }