private void HandleNavigateEntry(IFileSystemHistoryOperations entry) { var next = History.GetNext(entry); var selected = next != null ? (TFolder)next.DriveFolder : null; NavigateAsync(entry.DriveFolder, selected).ConfigureAwait(false); }
public IFileSystemHistoryOperations GetNext(IFileSystemHistoryOperations entry) { var index = _historyEntries.IndexOf(entry); if (index == _historyEntries.Count - 1) { return(null); } return(_historyEntries[index + 1]); }
private bool IsForwardEntry(IFileSystemHistoryOperations entry) { var c = Current; if (entry == c) { return(false); } var currentIndex = _historyEntries.IndexOf(c); var index = _historyEntries.IndexOf(entry); return(index > currentIndex); }
public void Add(IFileSystemHistoryOperations entry) { var c = Current; if (c != null) { var index = _historyEntries.IndexOf(Current); for (var i = _historyEntries.Count - 1; i > index; i--) { var forwardItem = _historyEntries[i]; _historyEntries.Remove(forwardItem); } } entry.Navigate -= HandleEntryNavigate; entry.Navigate += HandleEntryNavigate; _historyEntries.Add(entry); Current = entry; }