Beispiel #1
0
        public async void Add(IHistoryProvider _historyProvider)
        {
            _cache = new List <StorageFile>(_maxCapacity);

            int currentIndex = _historyProvider.Index;

            if (_historyProvider.Index == _historyProvider.Count - 1)
            {
                _cache.Add(_historyProvider.PreviousFile().Result);
                _cache.Add(_historyProvider.NextFile().Result);
            }

            if (_historyProvider.Index == 0)
            {
                _cache.Add(_historyProvider.CurrentFile().Result);
                _cache.Add(_historyProvider.NextFile().Result);
            }
            else
            {
                _cache.Add(_historyProvider.PreviousFile().Result);
                _cache.Add(_historyProvider.NextFile().Result);
                _cache.Add(_historyProvider.NextFile().Result);
            }

            _historyProvider.Index = currentIndex;
        }