Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="morphBundle"></param>
        /// <param name="wsVern"></param>
        /// <returns></returns>
        static public ITsString GetLexEntryTss(IWfiMorphBundle morphBundle, int wsVern)
        {
            LcmCache   cache   = morphBundle.Cache;
            LexEntryVc vcEntry = new LexEntryVc(cache);

            vcEntry.WritingSystemCode = wsVern;
            TsStringCollectorEnv collector = new TsStringCollectorEnv(null, cache.MainCacheAccessor, morphBundle.Hvo);

            collector.RequestAppendSpaceForFirstWordInNewParagraph = false;
            vcEntry.Display(collector, morphBundle.Hvo, (int)LexEntryVc.kfragEntryAndVariant);
            return(collector.Result);
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="cache"></param>
        /// <param name="hvoEntryToDisplay"></param>
        /// <param name="wsVern"></param>
        /// <param name="ler"></param>
        /// <returns></returns>
        static public ITsString GetLexEntryTss(LcmCache cache, int hvoEntryToDisplay, int wsVern, ILexEntryRef ler)
        {
            LexEntryVc vcEntry = new LexEntryVc(cache);

            vcEntry.WritingSystemCode = wsVern;
            TsStringCollectorEnv collector = new TsStringCollectorEnv(null, cache.MainCacheAccessor, hvoEntryToDisplay);

            collector.RequestAppendSpaceForFirstWordInNewParagraph = false;
            vcEntry.Display(collector, hvoEntryToDisplay, (int)VcFrags.kfragHeadWord);
            if (ler != null)
            {
                vcEntry.Display(collector, ler.Hvo, LexEntryVc.kfragVariantTypes);
            }
            return(collector.Result);
        }
Beispiel #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Keys the specified item.
        /// </summary>
        /// <param name="item">The item.</param>
        /// <param name="fForSorting">if set to <c>true</c> [f for sorting].</param>
        /// <returns></returns>
        /// ------------------------------------------------------------------------------------
        public ITsString Key(IManyOnePathSortItem item, bool fForSorting)
        {
            if (m_cache == null)
            {
                throw new ApplicationException("There's no way the browse VC (m_vc) can get a string in its current state.");
            }
            int hvo = item.RootObjectHvo;
            TsStringCollectorEnv collector;

            if (fForSorting)
            {
                collector = new SortCollectorEnv(null, m_sda, hvo);
            }
            else
            {
                collector = new TsStringCollectorEnv(null, m_sda, hvo);
            }

            // This will check to see if the VC is either null or disposed.  The disposed check is neccesary because
            // there are several instances where we can have a reference to an instance that was disposed, which will
            // cause problems later on.
            // Enhance CurtisH/EricP: If this VC gets used in other places, rather than adding more checks like this one,
            // it may be better to refactor XWorksViewBase to cause it to reload the sorter and filter from persistence
            // every time the tool is changed
            if (m_vc == null)
            {
                m_vc = new XmlBrowseViewBaseVc(m_cache, m_stringTbl);
                m_vc.SuppressPictures = true;                 // we won't dispose of it, so it mustn't make pictures (which we don't need)
                m_vc.DataAccess       = m_sda;
            }
            else
            {
                if (m_vc.Cache == null)
                {
                    m_vc.Cache = m_cache;
                }
                if (m_vc.Cache == null)
                {
                    throw new ApplicationException("There's no way the browse VC (m_vc) can get a string in its current state.");
                }
                if (m_vc.StringTbl == null)
                {
                    m_vc.StringTbl = m_stringTbl;
                }
            }
            m_vc.DisplayCell(item, m_colSpec, hvo, collector);
            return(collector.Result);
        }