/// <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 = null; // 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)); } ResultsTable ret = new ResultsTable(idxTable); return(ret); }
/// <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(); }
/// <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; }
/// <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; }