예제 #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new writing system
		/// </summary>
		/// <param name="fdoCache">The FDO cache</param>
		/// <param name="hvo">The HVO of the new writing system</param>
		/// <param name="icuLocale">The ICU locale</param>
		/// <param name="wsHvos">Array of writing system codes for the names of this new
		/// writing system.</param>
		/// <param name="names">Array of names for this writing system. Each member of this
		/// array is the name of the writing system in the corresponding language/ws in
		/// <paramref name="wsHvos"/></param>
		/// <returns>A new writing system object</returns>
		/// ------------------------------------------------------------------------------------
		public LgWritingSystem CreateWritingSystem(FdoCache fdoCache, int hvo, string icuLocale,
			int[] wsHvos, string[] names)
		{
			CheckDisposed();
			LgWritingSystem ws = new LgWritingSystem(fdoCache, hvo);
			ws.ICULocale = icuLocale;
			System.Diagnostics.Debug.Assert(wsHvos.Length == names.Length);

			for (int i = 0; i < wsHvos.Length; i++)
			{
				fdoCache.SetMultiUnicodeAlt(hvo,
					(int)LgWritingSystem.LgWritingSystemTags.kflidName, wsHvos[i],
					names[i]);
				if (Cache.LanguageWritingSystemFactoryAccessor.BypassInstall)
				{
					IWritingSystem lgws = Cache.LanguageWritingSystemFactoryAccessor.get_EngineOrNull(hvo);
					string displayName = lgws.get_Name(wsHvos[i]);
					if (String.IsNullOrEmpty(displayName))
						lgws.set_Name(wsHvos[i], names[i]);
					lgws.Dirty = false;
				}
			}

			return ws;
		}