本文整理汇总了C#中ITsString.get_IsRunOrc方法的典型用法代码示例。如果您正苦于以下问题:C# ITsString.get_IsRunOrc方法的具体用法?C# ITsString.get_IsRunOrc怎么用?C# ITsString.get_IsRunOrc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITsString
的用法示例。
在下文中一共展示了ITsString.get_IsRunOrc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddOrcsInBaseLineToBldr
/// ------------------------------------------------------------------------------------
/// <summary>
/// Adds any ORCs that are found in the specified baseline string to the specified
/// builder.
/// </summary>
/// ------------------------------------------------------------------------------------
private static void AddOrcsInBaseLineToBldr(ITsStrBldr bldr, ITsString baseLine,
int newOrcWs, bool appendOrc)
{
int insertedOrcCount = 0;
for (int i = 0; i < baseLine.RunCount; i++)
{
if (baseLine.get_IsRunOrc(i))
{
// Copy the ORC making sure to change any owned footnotes to unowned and
// changing the WS to the WS of the back translation.
ITsPropsBldr propsBldr = baseLine.get_Properties(i).GetBldr();
propsBldr.SetIntPropValues((int)FwTextPropType.ktptWs, 0, newOrcWs);
int runContainingNewOrc = (appendOrc && bldr.Length > 0) ? bldr.RunCount :
insertedOrcCount;
int orcPos = appendOrc ? bldr.Length : insertedOrcCount;
bldr.Replace(orcPos, orcPos, StringUtils.kszObject, propsBldr.GetTextProps());
TsStringUtils.TurnOwnedOrcIntoUnownedOrc(bldr, runContainingNewOrc);
insertedOrcCount++;
}
}
}
示例2: IsLabelText
/// ------------------------------------------------------------------------------------
/// <summary>
/// Test whether a run in a TsString contains 'label' text which should cause a segment break.
/// True if it has one of the interesting styles or the whole run is an ORC and
/// fTreatOrcsAsLabels is true.
/// Nb: this method won't detect hard line breaks. Hard line breaks are also forced
/// (elsewhere) to be their own segment.
/// </summary>
/// ------------------------------------------------------------------------------------
private static bool IsLabelText(ITsString tss, int irun, bool fTreatOrcsAsLabels)
{
return (IsLabelStyle(tss.Style(irun)) || (fTreatOrcsAsLabels && tss.get_IsRunOrc(irun)));
}
示例3: CreatePuncFormsInSegmentForOrcs
/// ------------------------------------------------------------------------------------
/// <summary>
/// Creates punctuation form analyses for all of the ORCs in the specified baseLine string.
/// </summary>
/// <param name="segment">The segment to which we are going to add the analyses.</param>
/// <param name="baseLine">The base line of the original segment from which we are moving
/// the ORCs.</param>
/// <param name="para">The paragraph that owns the given segment.</param>
/// <param name="iInsertPos">Index (0-based) in the sequence of analyses where the ORC
/// punctuation form(s) should be inserted.</param>
/// ------------------------------------------------------------------------------------
private static void CreatePuncFormsInSegmentForOrcs(ISegment segment, ITsString baseLine,
IScrTxtPara para, int iInsertPos)
{
if (!para.SegmentsOS.Any(seg => seg.AnalysesRS.Count > 0))
return;
for (int i = 0; i < baseLine.RunCount; i++)
{
if (baseLine.get_IsRunOrc(i))
{
IPunctuationForm orcForm = para.Cache.ServiceLocator.GetInstance<IPunctuationFormFactory>().Create();
orcForm.Form = baseLine.GetSubstring(baseLine.get_MinOfRun(i), baseLine.get_LimOfRun(i));
segment.AnalysesRS.Insert(iInsertPos++, orcForm);
}
}
}