/// <summary> /// Initialize the required inventories. /// </summary> private void InitializePartInventories(FdoCache cache, bool fLoadUserOverrides) { WriteSplashScreen(LexTextStrings.ksInitializingLayouts_); LayoutCache.InitializePartInventories(false, cache.DatabaseName, fLoadUserOverrides); int flid = BaseVirtualHandler.GetInstalledHandlerTag(cache, "LexDb", "CurrentReversalIndices"); if (flid == 0) flid = (int)LexDb.LexDbTags.kflidReversalIndexes; int[] rghvoIndexes = cache.GetVectorProperty(cache.LangProject.LexDbOA.Hvo, flid, false); foreach (int hvoIndex in rghvoIndexes) { int ws = cache.GetObjProperty(hvoIndex, (int)ReversalIndex.ReversalIndexTags.kflidWritingSystem); string sWs = cache.GetUnicodeProperty(ws, (int)LgWritingSystem.LgWritingSystemTags.kflidICULocale); LayoutCache.InitializeLayoutsForWsTag(sWs, cache.DatabaseName); } }
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 }; } } }