Beispiel #1
0
        public void BuildConcData()
        {
            // Get a character property engine that can distinguish word-forming and
            // other characters.
            ILgWritingSystemFactory    encf = m_cache.LanguageWritingSystemFactoryAccessor;
            ILgCharacterPropertyEngine cpe  = encf.get_UnicodeCharProps();

            Debug.Assert(cpe != null, "encf.get_UnicodeCharProps() returned null");

            foreach (StTxtPara stp in m_txt.ParagraphsOS)
            {
                AnalyzePara(stp, cpe);
            }
            m_alSummaries.Sort(new SimpleComparer());
            if (m_alSummaries.Count == 0)
            {
                return;
            }
            ITsStrFactory tsf         = (ITsStrFactory) new FwKernelLib.TsStrFactoryClass();
            ArrayList     alSublist   = new ArrayList();       // list for a given letter of alphabet.
            string        sKeyCurrent = ((MultiLevelConc.SummaryInfo)m_alSummaries[0]).Key.Substring(0, 1);

            foreach (MultiLevelConc.SummaryInfo si in m_alSummaries)
            {
                string sNewKey = si.Key.Substring(0, 1);
                if (string.Compare(sKeyCurrent, sNewKey, true) != 0)
                {
                    AddCharSummary(tsf, sKeyCurrent, alSublist, encf.get_UserWs());
                    alSublist   = new ArrayList();
                    sKeyCurrent = sNewKey;
                }
                alSublist.Add(si);
            }
            AddCharSummary(tsf, sKeyCurrent, alSublist, encf.get_UserWs());
        }
Beispiel #2
0
        public override void MakeRoot()
        {
            m_rootb = (IVwRootBox) new FwViews.VwRootBoxClass();
            m_rootb.SetSite(this);

            int hvoRoot = 1;

            m_sda = (ISilDataAccess) new FwViews.VwCacheDaClass();
            // Usually not here, but in some application global passed to each view.
            m_wsf = (ILgWritingSystemFactory) new FwLanguage.LgWritingSystemFactoryClass();
            m_sda.set_WritingSystemFactory(m_wsf);
            m_rootb.set_DataAccess(m_sda);

            ITsStrFactory tsf = (ITsStrFactory) new FwKernelLib.TsStrFactoryClass();
            ITsString     tss = tsf.MakeString("Hello World! This is a view", m_wsf.get_UserWs());

            IVwCacheDa cda = (IVwCacheDa)m_sda;

            cda.CacheStringProp(hvoRoot, ktagProp, tss);

            m_vVc = new HvVc();

            m_rootb.SetRootObject(hvoRoot, m_vVc, kfrText, null);
            m_fRootboxMade   = true;
            m_dxdLayoutWidth = -50000;             // Don't try to draw until we get OnSize and do layout.
        }
Beispiel #3
0
		public override void MakeRoot()
		{
			m_rootb = (IVwRootBox)new FwViews.VwRootBoxClass();
			m_rootb.SetSite(this);

			int hvoRoot = 1;

			m_sda = (ISilDataAccess) new FwViews.VwCacheDaClass();
			// Usually not here, but in some application global passed to each view.
			m_wsf = (ILgWritingSystemFactory) new FwLanguage.LgWritingSystemFactoryClass();
			m_sda.set_WritingSystemFactory(m_wsf);
			m_rootb.set_DataAccess(m_sda);

			ITsStrFactory tsf = (ITsStrFactory)new FwKernelLib.TsStrFactoryClass();
			ITsString tss = tsf.MakeString("Hello World! This is a view", m_wsf.get_UserWs());

			IVwCacheDa cda = (IVwCacheDa) m_sda;
			cda.CacheStringProp(hvoRoot, ktagProp, tss);

			m_vVc = new HvVc();

			m_rootb.SetRootObject(hvoRoot, m_vVc, kfrText, null);
			m_fRootboxMade = true;
			m_dxdLayoutWidth = -50000; // Don't try to draw until we get OnSize and do layout.
		}