本文整理汇总了C#中SIL.FieldWorks.FDO.FdoCache.ResetLanguageEncodings方法的典型用法代码示例。如果您正苦于以下问题:C# FdoCache.ResetLanguageEncodings方法的具体用法?C# FdoCache.ResetLanguageEncodings怎么用?C# FdoCache.ResetLanguageEncodings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SIL.FieldWorks.FDO.FdoCache
的用法示例。
在下文中一共展示了FdoCache.ResetLanguageEncodings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLgWritingSystem
/// ------------------------------------------------------------------------------------
/// <summary>
/// Obtain an interface to C# LgWritingSystem object for this locale in the database represented by this
/// cache. If necessary create it from the XML and install it.
/// </summary>
/// <param name="cache"></param>
/// <returns></returns>
/// ------------------------------------------------------------------------------------
public ILgWritingSystem GetLgWritingSystem(FdoCache cache)
{
IWritingSystem wsEngine = EnsureRealWs(cache.LanguageWritingSystemFactoryAccessor);
cache.ResetLanguageEncodings();
return (ILgWritingSystem)CmObject.CreateFromDBObject(cache, wsEngine.WritingSystem);
}
示例2: InvokeWritingSystemWizard
private void InvokeWritingSystemWizard(ContextMenuStrip cmnuAddWs, out ILgWritingSystem lws,
FdoCache cache, IHelpTopicProvider helpTopicProvider)
{
lws = null;
using (new WaitCursor(this))
{
using (WritingSystemWizard wiz = new WritingSystemWizard())
{
wiz.Init(cache.LanguageWritingSystemFactoryAccessor, helpTopicProvider);
if (wiz.ShowDialog() == DialogResult.OK)
{
// The engine from the wizard isn't the real one, so it doesn't have an id.
IWritingSystem wsEngine = wiz.WritingSystem();
string strws = wsEngine.IcuLocale;
ILgWritingSystemFactory wsf = cache.LanguageWritingSystemFactoryAccessor;
wsEngine = wsf.get_Engine(strws);
cache.ResetLanguageEncodings();
lws = LgWritingSystem.CreateFromDBObject(cache, wsEngine.WritingSystem);
}
}
}
}
示例3: FindOrCreateWs
/// ------------------------------------------------------------------------------------
/// <summary>
/// Finds or creates the writing system.
/// </summary>
/// <param name="cache">The cache.</param>
/// <param name="icuLocale">The icu locale.</param>
/// <returns>The writing system</returns>
/// ------------------------------------------------------------------------------------
private LgWritingSystem FindOrCreateWs(FdoCache cache, string icuLocale)
{
// Look to see if the writing system already exists in the database
foreach (LgWritingSystem ws in cache.LanguageEncodings)
{
if (LanguageDefinition.SameLocale(ws.ICULocale, icuLocale))
return ws;
}
// Create a new writing system based on the one noted in the XML file.
// Load it in from the XML and save into the database.
LanguageDefinitionFactory ldf =
new LanguageDefinitionFactory(cache.LanguageWritingSystemFactoryAccessor, icuLocale);
ldf.LanguageDefinition.SaveWritingSystem(icuLocale);
cache.ResetLanguageEncodings();
// search again. It better be there now!
foreach (LgWritingSystem ws in cache.LanguageEncodings)
{
if (LanguageDefinition.SameLocale(ws.ICULocale, icuLocale))
return ws;
}
Debug.Assert(false);
return null;
}