本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.GetIntProperty方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.GetIntProperty方法的具体用法?C# FdoCache.GetIntProperty怎么用?C# FdoCache.GetIntProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.FieldWorks.FDO.FdoCache
的用法示例。
在下文中一共展示了FdoCache.GetIntProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsIntroSection
/// ------------------------------------------------------------------------------------
/// <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;
}
示例2: SortChanges
/// <summary>
/// Sort the changes (by beginOffset)
/// </summary>
public void SortChanges(FdoCache cache)
{
m_changes.Sort(
delegate(int left, int right)
{
return cache.GetIntProperty(left, kflidBeginOffset).CompareTo(
cache.GetIntProperty(right, kflidBeginOffset));
});
}
示例3: GetTwficWs
/// <summary>
/// get the ws at the twfic's BeginOffset in its paragraph.
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="hvoTwfic">The hvo twfic.</param>
/// <returns></returns>
/// ------------------------------------------------------------------------------------
public static int GetTwficWs(FdoCache cache, int hvoTwfic)
{
Debug.Assert(cache.IsValidObject(hvoTwfic, CmBaseAnnotation.kClassId),
String.Format("expected valid hvo({0}).", hvoTwfic));
if (hvoTwfic <= 0 && !cache.IsDummyObject(hvoTwfic))
throw new ArgumentException(String.Format("expected valid hvo({0}).", hvoTwfic));
int hvoPara = cache.GetObjProperty(hvoTwfic,
(int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginObject);
int ichBeginOffset = cache.GetIntProperty(hvoTwfic,
(int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginOffset);
int ws = GetWsAtParaOffset(cache, hvoPara, ichBeginOffset);
return ws;
}
示例4: MakeNewContents
/// <summary>
/// Figure what the new contents needs to be. (Also sets OldContents.)
/// </summary>
/// <param name="cache"></param>
public void MakeNewContents(FdoCache cache, string oldSpelling, string newSpelling, RespellUndoAction action)
{
m_oldContents = RespellUndoAction.AnnotationTargetString(m_hvoTarget, m_flid, m_ws, cache);
ITsStrBldr bldr = m_oldContents.GetBldr();
SortChanges(cache);
for (int i = m_changes.Count - 1; i >= 0; i--)
{
int ichMin = cache.GetIntProperty(m_changes[i], (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidBeginOffset);
int ichLim = cache.GetIntProperty(m_changes[i], (int)CmBaseAnnotation.CmBaseAnnotationTags.kflidEndOffset);
string replacement = action.Replacement(action.OldOccurrence(m_changes[i]));
bldr.Replace(ichMin, ichLim, replacement, null);
}
m_newContents = bldr.GetString();
}