HandleMoveDest() public static method

This is a primary entry point for IStTxtPara.SetContentsForMoveDest. It is similar to the top-level AdjustAnalysis, except that we know exactly what was inserted where, AND, we know it came from another paragraph. If the source paragraph is analysed, we can transfer any relevant analysis. Enhance JohnT: Currently this only supports moving from the end of one paragraph to the end of another. This is sufficient for all current usages of the MoveString method which this supports.
public static HandleMoveDest ( IStTxtPara destPara, ITsString oldContents, int ichInsert, int cchInsert, IStTxtPara sourcePara, int ichSource, bool fDestParaIsNew ) : void
destPara IStTxtPara
oldContents ITsString
ichInsert int
cchInsert int
sourcePara IStTxtPara
ichSource int
fDestParaIsNew bool
return void
Exemplo n.º 1
0
		/// <summary>
		/// This is a primary entry point for IStTxtPara.SetContentsForMoveDest. It is similar to the
		/// top-level AdjustAnalysis, except that we know exactly what was inserted where, AND,
		/// we know it came from another paragraph. If the source paragraph is analysed, we can transfer any relevant
		/// analysis.
		/// Enhance JohnT: Currently this only supports moving from the end of one paragraph to the end of another.
		/// This is sufficient for all current usages of the MoveString method which this supports.
		/// </summary>
		public static void HandleMoveDest(IStTxtPara destPara, ITsString oldContents, int ichInsert,
			int cchInsert, IStTxtPara sourcePara, int ichSource, bool fDestParaIsNew)
		{
			if (ichInsert != destPara.Contents.Length - cchInsert)
				throw new NotImplementedException("We do not yet support moving strings to destinations other than paragraph end.");
			if (ichSource + cchInsert != sourcePara.Contents.Length)
				throw new NotImplementedException("We do not yet support moving strings from sources other than paragraph end.");

			AnalysisAdjuster adjuster = new AnalysisAdjuster(destPara, oldContents, new TsStringDiffInfo(ichInsert));
			BackTranslationAndFreeTranslationUpdateHelper.Do(destPara, () =>
				adjuster.HandleMoveDest(cchInsert, sourcePara, ichSource, fDestParaIsNew));
		}