Пример #1
0
        /// <summary>
        /// Applies a SearchCriteria to the index.
        /// </summary>
        /// <param name="crit">The SearchCriteria to apply.</param>
        /// <returns>A ResultsTable that contains the result of applying the criteria.</returns>
        public ResultsTable GenerateResultsTable(SearchCriteria crit)
        {
            Debug.Assert(crit != null);

            CodeElementWrapperArrayIndexTable idxTable;

            // If using all criteria, perform a copy.
            if (crit.ElementFilter == CodeElementType.All)
            {
                idxTable = (CodeElementWrapperArrayIndexTable)indexTable.Clone();
            }
            else
            {
                idxTable = new CodeElementWrapperArrayIndexTable(codeElementArray);

                for (int i = 0; i < codeElementArray.Count; i++)
                {
                    if (codeElementArray[i].ElementType == crit.ElementFilter)
                    {
                        idxTable.Add(i);
                    }
                }

                idxTable.Sort(new SortCriteria(SortCriteria.SortType.ALPHA));
            }

            var ret = new ResultsTable(idxTable);

            return(ret);
        }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the CodeElementWrapperArrayIndexTable
 /// class and copies another instance to it.
 /// </summary>
 /// <param name="copy">The CodeElementWrapperArrayIndexTable object to copy.</param>
 public CodeElementWrapperArrayIndexTable(CodeElementWrapperArrayIndexTable copy)
 {
     list = new List <int>(copy.list);
     codeElementWrapperArray = copy.codeElementWrapperArray;
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the IndexTable class.
        /// </summary>
        /// <param name="indexTable">A CodeElementWrapperArrayIndexTable object.</param>
        protected IndexTable(CodeElementWrapperArrayIndexTable indexTable)
        {
            Debug.Assert(indexTable != null);

            this.indexTable = indexTable;
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the ResultsTable class.
 /// </summary>
 /// <param name="indexTable">A CodeElementWrapperArrayIndexTable object to initialize from.</param>
 public ResultsTable(CodeElementWrapperArrayIndexTable indexTable) : base(indexTable)
 {
     Reset();
 }