Example #1
0
        public virtual ShoeModel[] GetSelectedPage(int pageNo)
        {
            int firstIndex = pageNo * _pageSize;

            firstIndex = firstIndex >= 0 ? firstIndex : 0;
            int lastIndex = firstIndex + _pageSize - 1;

            _currentSelectedPage = new ShoeModel[_pageSize];
            ShoeModel tmpShoe;

            for (int i = firstIndex, j = 0; i <= lastIndex; ++i, ++j)
            {
                if (i < _selectedCount)
                {
                    tmpShoe = (ShoeModel)_selectedShoes[i];
                }
                else
                {
                    tmpShoe = new NullShoeModel();
                }

                _currentSelectedPage[j] = tmpShoe;
            }

            return(_currentSelectedPage);
        }
Example #2
0
        public void ClearSelection()
        {
            foreach (ShoeModel shoe in _scrapedShoes)
            {
                shoe.Selected = false;
            }

            for (int i = 0; i < _pageSize; ++i)
            {
                _currentSelectedPage[i] = new NullShoeModel();
            }

            _selectedShoes.Clear();
            _selectedCount = _selectedShoes.Count;
        }