コード例 #1
0
        /// <summary>
        /// Verify that there is a row with the specified index that has a cell with the specified
        /// index which belongs to the specified column (instanceOf) and appliesTo the specified words
        /// and has the specified marker (if any).
        /// </summary>
        /// <param name="rowIndex"></param>
        /// <param name="cellIndex"></param>
        /// <param name="hvoColumn"></param>
        /// <param name="words"></param>
        /// <param name="marker"></param>
        internal void VerifyCca(int rowIndex, int ccaIndex, int hvoColumn, int[] words, string marker)
        {
            ICmIndirectAnnotation cca = VerifyCcaBasic(rowIndex, ccaIndex, hvoColumn) as ICmIndirectAnnotation;

            Assert.IsNotNull(cca, "Cca should be indirect annotation");
            Assert.AreEqual(words, cca.AppliesToRS.HvoArray);
            string comment = cca.Comment.AnalysisDefaultWritingSystem.Text;

            if (comment == null)
            {
                comment = "";
            }
            Assert.AreEqual(marker, comment);
            Assert.AreEqual(CmAnnotationDefn.ConstituentChartAnnotation(Cache), cca.AnnotationTypeRA);
        }
コード例 #2
0
        private ICmAnnotation VerifyCcaBasic(int rowIndex, int ccaIndex, int hvoColumn)
        {
            int crows = m_chart.RowsRS.Count;

            Assert.IsTrue(rowIndex <= crows);
            CmIndirectAnnotation row = (CmIndirectAnnotation)m_chart.RowsRS[rowIndex];
            int cCells = row.AppliesToRS.Count;

            Assert.IsTrue(ccaIndex < cCells);
            ICmAnnotation cca = row.AppliesToRS[ccaIndex];

            Assert.AreEqual(hvoColumn, cca.InstanceOfRAHvo);
            Assert.AreEqual(CmAnnotationDefn.ConstituentChartAnnotation(Cache), cca.AnnotationTypeRA);
            return(cca);
        }
コード例 #3
0
ファイル: DiscourseDbOps.cs プロジェクト: sillsdev/WorldPad
        /// <summary>
        /// Return the next wfics that have not yet been added to the chart (up to maxContext of them).
        /// </summary>
        /// <param name="maxContext"></param>
        /// <returns></returns>
        public static int[] NextUnusedInput(FdoCache cache, int hvoStText, int maxContext, int hvoChart)
        {
            int hvoWficDefn = CmAnnotationDefn.Twfic(cache).Hvo;
            int hvoCcaDefn  = CmAnnotationDefn.ConstituentChartAnnotation(cache).Hvo;
            // First two lines yield annotations on the right text of the right type (wfics).
            // balance further limits it to uncharted ones
            string sql =
                "select top(" + maxContext + ") cba.id, stp.owner$ from CmBaseAnnotation_ cba"
                + " join StTxtPara_ stp on cba.BeginObject = stp.id and cba.AnnotationType = " + hvoWficDefn
                + " and stp.OwnFlid$ = 14001 and stp.Owner$ = " + hvoStText
                + " where not exists(Select * from DsConstChart_Rows row"
                + " join CmIndirectAnnotation_AppliesTo row_cca on row_cca.src = row.Dst and row.Src = " + hvoChart
                + " join CmIndirectAnnotation_AppliesTo cca_cba on cca_cba.src = row_cca.dst and cca_cba.Dst = cba.id)"
                + " order by stp.OwnOrd$, cba.BeginOffset";

            return(DbOps.ReadIntArrayFromCommand(cache, sql, null));
        }
コード例 #4
0
 private void InitializeCca(ICmAnnotation cca, int icol, ICmIndirectAnnotation row)
 {
     cca.InstanceOfRAHvo = m_allColumns[icol];
     row.AppliesToRS.Append(cca);
     cca.AnnotationTypeRA = CmAnnotationDefn.ConstituentChartAnnotation(Cache);
 }