src/Misc/EFTools/XmlCore/UI/ViewModels/Explorer/ExplorerSearchResults.cs
/// <summary>
///     Get previous Search Result and update Next and Previous pointers
/// </summary>
Get previous Search Result and update Next and Previous pointers
Get previous Search Result and update Next and Previous pointers
internal ExplorerEFElement SelectPreviousSearchResult()
        {
            var itemToBeReturned = _previousSearchResultItem;
            if (null != _previousSearchResultItem)
            {
                if (_currentSelectionIsInResults)
                {
                    if (null == _nextSearchResultItem)
                    {
                        _nextSearchResultItemIndex = _results.Count - 1;
                    }
                    else
                    {
                        _nextSearchResultItemIndex--;
                    }
                    _nextSearchResultItem = _results[_nextSearchResultItemIndex];
                }
                else
                {
                    _currentSelectionIsInResults = true;
                }
                _previousSearchResultItemIndex--;
                if (_previousSearchResultItemIndex < 0)
                {
                    _previousSearchResultItem = null;
                    _previousSearchResultItemIndex = -1;
                }
                else
                {
                    _previousSearchResultItem = _results[_previousSearchResultItemIndex];
                }
            }
            return itemToBeReturned;
        }
internal ExplorerEFElement SelectPreviousSearchResult ( ) { var itemToBeReturned = _previousSearchResultItem ; if ( null != _previousSearchResultItem ) { if ( _currentSelectionIsInResults ) { if ( null == _nextSearchResultItem ) { _nextSearchResultItemIndex = _results . Count - 1 ; } else { _nextSearchResultItemIndex -- ; } _nextSearchResultItem = _results [ _nextSearchResultItemIndex ] ; } else { _currentSelectionIsInResults = true ; } _previousSearchResultItemIndex -- ; if ( _previousSearchResultItemIndex < 0 ) { _previousSearchResultItem = null ; _previousSearchResultItemIndex = - 1 ; } else { _previousSearchResultItem = _results [ _previousSearchResultItemIndex ] ; } } return itemToBeReturned ; }
Get previous Search Result and update Next and Previous pointers
Get previous Search Result and update Next and Previous pointers
// there was no next search item - make the next item the end of the list // the currently selected item is now in the results // but Next does not need to be updated