Exemple #1
0
        public void AnnotationStringValue()
        {
            // Use old-style creation to support in-memory testing; cf CmBaseAnnotation.CreateUnownedCba.
            CmBaseAnnotation ann = new CmBaseAnnotation();

            Cache.LangProject.AnnotationsOC.Add(ann);
            ann.BeginOffset = 4;
            ann.EndOffset   = 10;
            // The below is a non-standard usage of the TextOA field. It works for this test as a place
            // to store the text we're testing, but normally it's purpose is for a (possibly) multi-paragraph
            // commentary on the target of the annotation (pointed to by BeginObject). This would be similar to
            // how a ScriptureNote.Discussion points to a JournalText (subclass of StText).
            ann.TextOA = new StText();
            StTxtPara para = new StTxtPara();

            ann.TextOA.ParagraphsOS.Append(para);
            para.Contents.Text = "pus yalola nihimbilira. nihimbilira pus yalola. hesyla nihimbilira.";
            ann.BeginObjectRA  = para;
            ann.EndObjectRA    = para;
            ann.Flid           = (int)StTxtPara.StTxtParaTags.kflidContents;

            // Install the virtual property and get its id.
            int flid = CmBaseAnnotation.StringValuePropId(Cache);

            // The text of the annotation should be 'yalola'.
            Assert.AreEqual("yalola", Cache.MainCacheAccessor.get_StringProp(ann.Hvo, flid).Text,
                            "Wrong StringValue for 'yalola' annotation");
        }
        protected InterlinearExporter(FdoCache cache, XmlWriter writer, int hvoRoot, InterlinLineChoices lineChoices, InterlinVc vc, ITsString tssTextName, ITsString tssTextAbbreviation)
            : base(null, cache.MainCacheAccessor, hvoRoot)
        {
            m_cache                = cache;
            m_writer               = writer;
            ktagParaSegments       = InterlinVc.ParaSegmentTag(cache);
            ktagSegmentForms       = InterlinVc.SegmentFormsTag(cache);
            m_flidStringValue      = CmBaseAnnotation.StringValuePropId(cache);
            m_lineChoices          = lineChoices;
            m_defaultGlossVirtFlid = BaseVirtualHandler.GetInstalledHandlerTag(m_cache, "WfiMorphBundle", "DefaultSense");
            m_vc = vc;
            m_tssPendingTitle      = tssTextName;
            m_tssTitleAbbreviation = tssTextAbbreviation;

            // Get morphtype information that we need later.  (plus stuff we don't...)  See LT-8288.
            IMoMorphType mmtStem;
            IMoMorphType mmtPrefix;
            IMoMorphType mmtSuffix;
            IMoMorphType mmtInfix;
            IMoMorphType mmtBoundStem;
            IMoMorphType mmtSimulfix;
            IMoMorphType mmtSuprafix;

            MoMorphType.GetMajorMorphTypes(cache, out mmtStem, out mmtPrefix, out mmtSuffix, out mmtInfix,
                                           out mmtBoundStem, out m_mmtProclitic, out m_mmtEnclitic, out mmtSimulfix, out mmtSuprafix);
        }