示例#1
0
        public void Push(string newLocation)
        {
            if (_currentIndex > -1 && newLocation == _locations[_currentIndex].FullPath)
                return;
            if (Current != null)
                Current.SelectedPath = newLocation;

            _currentIndex++;
            _maxIndex = _currentIndex;

            var currentView = ListerManager.Instance.ListerViewManager.CurrentListerView;
            var listerType = currentView != null
                                       ? currentView.Lister.GetType()
                                       : typeof (FileLister);
            _locations[_currentIndex] = new HistoryItem(newLocation, _currentIndex, listerType);
        }
示例#2
0
 private bool EnsureListerType(HistoryItem historyItem)
 {
     if (historyItem == null) return false;
     if (historyItem.ListerType != CurrentView.Lister.GetType())
     {
         var baseLister = CurrentView.Lister;
         var lister = historyItem.ListerType
             .GetConstructor(new [] { typeof(ILister), typeof(string) })
             .Invoke(new object[] {baseLister, historyItem.FullPath });
         CurrentView.Lister = lister as ILister;
         return false;
     }
     return true;
 }