Ejemplo n.º 1
0
        /// <summary>
        /// Clear all text. If fReconstruct is true, also clears the display.
        /// </summary>
        public void Clear(bool fReconstruct)
        {
            CheckDisposed();

            if (m_sda == null)
            {
                var cda = VwCacheDaClass.Create();
                cda.TsStrFactory = TsStringUtils.TsStrFactory;
                m_sda            = cda;
                if (WritingSystemFactory != null)
                {
                    m_sda.WritingSystemFactory = WritingSystemFactory;
                }
                m_cd = cda;
            }
            else
            {
                m_hvoNextPara = khvoFirstPara;
                m_cd.CacheVecProp(m_hvoRoot, (int)SampleTags.ktagTextParas, new int[0], 0);
                if (fReconstruct)
                {
                    RootBox.Reconstruct();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Call this when done adding paragraphs. The typical calling sequence is
        /// Clear(), AddPara() x n, CompleteSetText().
        /// </summary>
        public void CompleteSetText()
        {
            CheckDisposed();

            int[] rghvo = new int[m_hvoNextPara - khvoFirstPara];
            for (int i = 0; i < rghvo.Length; ++i)
            {
                rghvo[i] = i + khvoFirstPara;
            }
            m_cd.CacheVecProp(m_hvoRoot, (int)SampleTags.ktagTextParas, rghvo, rghvo.Length);
            RootBox.Reconstruct();
            RootBox.MakeSimpleSel(true, true, false, true);
        }
Ejemplo n.º 3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Resets the tables.
        /// </summary>
        /// <param name="sLayoutName">Name of the s layout.</param>
        /// ------------------------------------------------------------------------------------
        public void ResetTables(string sLayoutName)
        {
            CheckDisposed();

            // Don't crash if we don't have any view content yet.  See LT-7244.
            if (m_xmlVc != null)
            {
                m_xmlVc.ResetTables(sLayoutName);
            }
            if (RootBox != null)
            {
                RootBox.Reconstruct();
            }
        }