public override void MakeRoot() { CheckDisposed(); base.MakeRoot(); if (DesignMode) { return; } m_fdoCache.CreateDummyID(out m_hvoRoot); // Pretend it is of our expected destination class. Very few things should care about this, // but it allows IsValidObject to return true for it, which is important when reconstructing // the root box, as happens during Refresh. m_fdoCache.VwCacheDaAccessor.CacheIntProp(m_hvoRoot, (int)CmObjectFields.kflidCmObject_Class, (int)m_clidDst); // Review JohnT: why doesn't the base class do this?? m_rootb = VwRootBoxClass.Create(); m_rootb.SetSite(this); m_sda = m_fdoCache.MainCacheAccessor; IVwCacheDa cda = m_sda as IVwCacheDa; IVwVirtualHandler vh = cda.GetVirtualHandlerName(GhostStringVirtualHandler.GhostClassName, GhostStringVirtualHandler.FieldNameForWs(m_wsToCreate)); if (vh == null) { vh = new GhostStringVirtualHandler(m_wsToCreate); cda.InstallVirtual(vh); } m_flidGhost = vh.Tag; m_rootb.DataAccess = m_sda; m_vc = new GhostStringSliceVc(m_flidGhost); // arg3 is a meaningless initial fragment, since this VC only displays one thing. m_rootb.SetRootObject(m_hvoRoot, m_vc, 1, m_styleSheet); }
public override void MakeRoot() { CheckDisposed(); base.MakeRoot(); if (DesignMode) return; m_fdoCache.CreateDummyID(out m_hvoRoot); // Pretend it is of our expected destination class. Very few things should care about this, // but it allows IsValidObject to return true for it, which is important when reconstructing // the root box, as happens during Refresh. m_fdoCache.VwCacheDaAccessor.CacheIntProp(m_hvoRoot, (int)CmObjectFields.kflidCmObject_Class, (int)m_clidDst); // Review JohnT: why doesn't the base class do this?? m_rootb = VwRootBoxClass.Create(); m_rootb.SetSite(this); m_sda = m_fdoCache.MainCacheAccessor; IVwCacheDa cda = m_sda as IVwCacheDa; IVwVirtualHandler vh = cda.GetVirtualHandlerName(GhostStringVirtualHandler.GhostClassName, GhostStringVirtualHandler.FieldNameForWs(m_wsToCreate)); if (vh == null) { vh = new GhostStringVirtualHandler(m_wsToCreate); cda.InstallVirtual(vh); } m_flidGhost = vh.Tag; m_rootb.DataAccess = m_sda; m_vc = new GhostStringSliceVc(m_flidGhost); // arg3 is a meaningless initial fragment, since this VC only displays one thing. m_rootb.SetRootObject(m_hvoRoot, m_vc, 1, m_styleSheet); }