/// <summary> /// Validate the annotation information stored in the xml configuration against /// the annotation information stored in memory from ParagraphParser. /// </summary> /// <param name="fSkipForceParse">skips parsing if the text has not changed.</param> internal void ValidateAnnotations(bool fSkipForceParse) { Debug.Assert(m_para != null); Debug.Assert(m_para == m_pb.ActualParagraph); if (fSkipForceParse) { // just sync the defn with expected valid ids. m_pb.ResyncExpectedAnnotationIds(); } else if (NeedReparseParagraph) { ReparseParagraph(); } if (m_pb.NeedToRebuildParagraphContentFromAnnotations) { m_pb.RebuildParagraphContentFromAnnotations(); } ConceptualModelXmlParagraphValidator validator = new ConceptualModelXmlParagraphValidator(m_pb); validator.ValidateParagraphs(m_pb.ParagraphDefinition, m_pb.ActualParagraph); }
private void ValidateParagraphAnnotations(int hvoPara) { ParagraphBuilder pb = GetParagraphBuilder(hvoPara); if (pb != null && pb.ParagraphDefinition != null) { // make sure our real annotation offsets match the actual text. pb.ReconstructSegmentsAndXfics(); ConceptualModelXmlParagraphValidator cmpv = new ConceptualModelXmlParagraphValidator(pb); cmpv.ValidateActualParagraphAgainstDefn(); } else { // we aren't expecting any annotations for this paragraph. Make sure we don't // have anything referencing the paragraph. StTxtPara para = StTxtPara.CreateFromDBObject(Cache, hvoPara) as StTxtPara; Assert.AreEqual(0, para.LinkedObjects.Count); } }