示例#1
0
        /// <summary>
        /// Call this method to build the help-index and fill the internal list box
        /// </summary>
        /// <param name="index">Index instance extracted from the chm file(s)</param>
        /// <param name="typeOfIndex">type of index to display</param>
        /// <param name="filter">information type/category filter</param>
        public void BuildIndex(HtmlHelpIndex index, IndexType typeOfIndex,
                               InfoTypeCategoryFilter filter)
        {
            switch (typeOfIndex)
            {
            case IndexType.AssiciativeLinks:
                _arrIndex = index.ALinks;
                break;

            case IndexType.KeywordLinks:
                _arrIndex = index.KLinks;
                break;
            }

            lbIndex.Items.Clear();

            foreach (HtmlHelpIndexItem curItem in _arrIndex)
            {
                bool bAdd = true;

                if (filter != null)
                {
                    bAdd = false;

                    if (curItem.InfoTypeStrings.Count <= 0)
                    {
                        bAdd = true;
                    }
                    else
                    {
                        for (int i = 0; i < curItem.InfoTypeStrings.Count; i++)
                        {
                            bAdd |= filter.Match(curItem.InfoTypeStrings[i].ToString());
                        }
                    }
                }

                if (bAdd)
                {
                    lbIndex.Items.Add(curItem.IndentKeyWord);
                }
            }
        }
示例#2
0
 /// <summary>
 /// Call this method to build the help-index and fill the internal list box
 /// </summary>
 /// <param name="index">Index instance extracted from the chm file(s)</param>
 /// <param name="typeOfIndex">type of index to display</param>
 public void BuildIndex(HtmlHelpIndex index, IndexType typeOfIndex)
 {
     BuildIndex(index, typeOfIndex, null);
 }