SIL.CoreImpl.PalasoWritingSystemManager.get_Engine C# (CSharp) Method

get_Engine() public method

Get the actual writing system object for a given ICU Locale string. The current implementation returns any existing writing system for that ICU Locale, or creates one with default settings if one is not already known. (Use get_EngineOrNull to avoid automatic creation of a new engine.)
public get_Engine ( string bstrIdentifier ) : ILgWritingSystem
bstrIdentifier string The identifier.
return ILgWritingSystem
		public ILgWritingSystem get_Engine(string bstrIdentifier)
		{
			IWritingSystem ws;
			GetOrSet(bstrIdentifier, out ws);
			return ws;
		}

Usage Example

Ejemplo n.º 1
0
		public void TestTsStringWrapperRoundTrip(string str1, string namedStyle1, string str2, string namedStyle2)
		{
			var wsFact = new PalasoWritingSystemManager();
			ITsStrBldr bldr = TsStrBldrClass.Create();
			ITsPropsBldr ttpBldr = TsPropsBldrClass.Create();
			try
			{
				wsFact.get_Engine("en");
				ttpBldr.SetIntPropValues((int)FwTextPropType.ktptWs, (int)FwTextPropVar.ktpvDefault, wsFact.GetWsFromStr("en"));
				ttpBldr.SetStrPropValue((int)FwTextPropType.ktptNamedStyle, namedStyle1);
				bldr.Replace(bldr.Length, bldr.Length, str1, ttpBldr.GetTextProps());
				if (namedStyle2 != null && str2 != null)
				{
					ttpBldr.SetStrPropValue((int)FwTextPropType.ktptNamedStyle, namedStyle2);
					bldr.Replace(bldr.Length, bldr.Length, str2, ttpBldr.GetTextProps());
				}
				var tsString1 = bldr.GetString();

				var strWrapper = new TsStringWrapper(tsString1, wsFact);

				var tsString2 = strWrapper.GetTsString(wsFact);

				Assert.AreEqual(tsString1.Text, tsString2.Text);
			}
			finally
			{
				Marshal.ReleaseComObject(ttpBldr);
				Marshal.ReleaseComObject(bldr);
			}
		}
All Usage Examples Of SIL.CoreImpl.PalasoWritingSystemManager::get_Engine