/// <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)); }
/// <summary> /// This is the main entry point called by the setter on the StTxtPara.Contents used when the /// GetDiffsInTsStrings is also needed by another method that is called. /// </summary> public static void AdjustAnalysis(IStTxtPara para, ITsString oldContents, TsStringDiffInfo diffInfo) { AnalysisAdjuster adjuster = new AnalysisAdjuster(para, oldContents, diffInfo); BackTranslationAndFreeTranslationUpdateHelper.Do(para, adjuster.AdjustAnalysisInternal); }