Example #1
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.
        }
Example #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.
		}