private void AddNavigationHistory(ViewerBaseVM item) { if (NavigationPosition != -1) { for (int i = 0; i < NavigationPosition; i++) { NavigationHistory.RemoveAt(0); } } while (NavigationHistory.Count > 10) { NavigationHistory.RemoveAt(NavigationHistory.Count - 1); } if (NavigationHistory.IndexOf(item) != -1) { NavigationHistory.Remove(item); } NavigationHistory.Insert(0, item); NavigationPosition = 0; //if (jpList != null) //{ // jpList.AddToRecent(item.EmbeddedDirectoryModel.EmbeddedDirectoryEntry.ParseName); // jpList.Refresh(); //} }
public void Add(IEntryViewModel item) { _updatingNavigationHistory = true; try { //GC.Collect(0, GCCollectionMode.Forced, true); if (NavigationPosition != -1) { for (int i = 0; i < NavigationPosition; i++) { NavigationHistory.RemoveAt(0); } } while (NavigationHistory.Count > 10) { NavigationHistory.RemoveAt(NavigationHistory.Count - 1); } if (NavigationHistory.IndexOf(item) != -1) { NavigationHistory.Remove(item); } NavigationHistory.Insert(0, item); NavigationPosition = 0; UpdateState(); } finally { _updatingNavigationHistory = false; } }
internal void ChangeNavigationPosition(ViewerBaseVM item) { int pos = NavigationHistory.IndexOf(item); if (pos != -1) { ChangeNavigationPosition(pos); } }