本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.GetMultiStringAlt方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.GetMultiStringAlt方法的具体用法?C# FdoCache.GetMultiStringAlt怎么用?C# FdoCache.GetMultiStringAlt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.FieldWorks.FDO.FdoCache
的用法示例。
在下文中一共展示了FdoCache.GetMultiStringAlt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteRedundantCapitalizedWordform
/// <summary>
/// If hvoWordform is the hvo of a capitalized wordform which has no useful information,
/// delete it. It is considered useless if
/// - it has no occurrences
/// - it has no anlyses
/// - it doesn't have known incorrect spelling status.
/// Note that the argument may be some other kind of object (typically a WfiAnalysis or WfiGloss).
/// If so do nothing.
/// </summary>
public static void DeleteRedundantCapitalizedWordform(FdoCache cache, int hvoWordform)
{
if (cache.GetClassOfObject(hvoWordform) != WfiWordform.kclsidWfiWordform)
return;
if (cache.GetVectorProperty(hvoWordform, OccurrencesFlid(cache), true).Length != 0)
return;
if (cache.IsValidObject(hvoWordform))
{
// If it's real it might have analyses etc.
WfiWordform wf = (WfiWordform) CmObject.CreateFromDBObject(cache, hvoWordform);
if (wf.AnalysesOC.Count > 0)
return;
// Arguably we should keep it for known correct spelling status. However, if it's ever been
// confirmed as an analysis, even temporarily, it will have that.
if (wf.SpellingStatus == (int)SpellingStatusStates.incorrect)
return;
}
foreach (int ws in cache.LangProject.CurVernWssRS.HvoArray)
{
CaseFunctions cf = new CaseFunctions(cache.LanguageWritingSystemFactoryAccessor.get_EngineOrNull(ws).IcuLocale);
string text = cache.GetMultiStringAlt(hvoWordform, (int) WfiWordformTags.kflidForm, ws).Text;
if (!String.IsNullOrEmpty(text) && cf.StringCase(text) == StringCaseStatus.allLower)
return;
}
cache.DeleteObject(hvoWordform);
}
示例2: AnnotationTargetString
internal static ITsString AnnotationTargetString(int hvoTarget, int flid, int ws, FdoCache cache)
{
ITsString tssValue;
if (IsMultilingual(flid))
{
tssValue = cache.GetMultiStringAlt(hvoTarget, flid, ws);
}
else
{
tssValue = cache.GetTsStringProperty(hvoTarget, flid);
}
return tssValue;
}
示例3: AddStringFromOtherObj
internal static string[] AddStringFromOtherObj(XmlNode frag, int hvoTarget, FdoCache cache)
{
int flid = XmlVc.GetFlid(frag, hvoTarget, cache);
ITsStrFactory tsf = TsStrFactoryClass.Create();
FieldType itype = cache.GetFieldType(flid);
if ((itype == FieldType.kcptUnicode) ||
(itype == FieldType.kcptBigUnicode))
{
return new string[] {cache.GetUnicodeProperty(hvoTarget, flid)};
}
else if ((itype == FieldType.kcptString) ||
(itype == FieldType.kcptBigString))
{
return new string[] { cache.GetTsStringProperty(hvoTarget, flid).Text };
}
else // multistring of some type
{
int wsid = 0;
string sep = "";
if (s_cwsMulti > 1)
{
string sLabelWs = XmlUtils.GetOptionalAttributeValue(frag, "ws");
if (sLabelWs != null && sLabelWs == "current")
{
sep = DisplayMultiSep(frag, cache)
+ DisplayWsLabel(s_qwsCurrent, cache);
wsid = s_qwsCurrent.WritingSystem;
}
}
if (wsid == 0)
wsid = LangProject.GetWritingSystem(frag, cache, null, LangProject.kwsAnal);
if ((itype == FieldType.kcptMultiUnicode) ||
(itype == FieldType.kcptMultiBigUnicode))
{
return new string[] {sep, cache.GetMultiUnicodeAlt(hvoTarget, flid, wsid, null) };
}
else
{
return new string[] {sep, cache.GetMultiStringAlt(hvoTarget, flid, wsid).Text };
}
}
}
示例4: SetupWritingSystemsForTitle
private void SetupWritingSystemsForTitle(FdoCache cache)
{
m_ttpWsLabel = LgWritingSystem.AbbreviationTextProperties;
m_writingSystems = new LgWritingSystem[2];
m_writingSystems[0] = new LgWritingSystem(cache, cache.DefaultVernWs);
m_writingSystems[1] = new LgWritingSystem(cache, cache.DefaultAnalWs);
m_WsLabels = new ITsString[m_writingSystems.Length];
int wsEn = cache.LanguageWritingSystemFactoryAccessor.GetWsFromStr("en");
if (wsEn == 0)
wsEn = cache.DefaultUserWs;
if (wsEn == 0)
wsEn = cache.FallbackUserWs;
for (int i = 0; i < m_writingSystems.Length; i++)
{
//m_WsLabels[i] = LgWritingSystem.UserAbbr(cache, m_writingSystems[i].Hvo);
// For now (August 2008), try English abbreviation before UI writing system.
// (See LT-8185.)
m_WsLabels[i] = cache.GetMultiStringAlt(m_writingSystems[i].Hvo,
(int)LgWritingSystem.LgWritingSystemTags.kflidAbbr, wsEn);
if (String.IsNullOrEmpty(m_WsLabels[i].Text))
m_WsLabels[i] = LgWritingSystem.UserAbbr(cache, m_writingSystems[i].Hvo);
}
}