当前位置: 首页>>代码示例>>C#>>正文


C# FdoCache.ResetLanguageEncodings方法代码示例

本文整理汇总了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);
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:14,代码来源:CmObject.cs

示例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);
					}
				}
			}
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:22,代码来源:FwProjPropertiesDlg.cs

示例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;
		}
开发者ID:sillsdev,项目名称:WorldPad,代码行数:32,代码来源:FwNewLangProjectCreator.cs


注:本文中的SIL.FieldWorks.FDO.FdoCache.ResetLanguageEncodings方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。