Esempio n. 1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Add an empty translation of the specified type to the paragraph, or return the
		/// existing one.
		/// </summary>
		/// <param name="owner">the owning paragraph</param>
		/// <param name="transType">The type of translation to create</param>
		/// <param name="wsTrans">The writing system of the translation</param>
		/// <returns></returns>
		/// ------------------------------------------------------------------------------------
		public ICmTranslation AddTransToMockedParagraph(StTxtPara owner, Guid transType,
			int wsTrans)
		{
			CheckDisposed();
			ICmTranslation trans = owner.GetTrans(transType);
			if (trans == null)
			{
				int hvo = m_cacheBase.NewHvo(CmTranslation.kClassId);
				m_cacheBase.AppendToFdoVector(owner.Hvo,
					(int)StTxtPara.StTxtParaTags.kflidTranslations, hvo);
				m_cacheBase.SetBasicProps(hvo, owner.Hvo, (int)CmTranslation.kClassId,
					(int)StTxtPara.StTxtParaTags.kflidTranslations, 1);
				trans = new CmTranslation(Cache, hvo);
				trans.TypeRA = m_lp.TranslationTagsOA.LookupPossibilityByGuid(transType);
			}
			trans.Translation.GetAlternative(wsTrans).Text = string.Empty;
			return trans;
		}