public void Remove(VisitedPage visitedPage) { VisitedPageList.Remove(visitedPage); var lastPage = GetLast(); UpdateCurrent(true, lastPage); }
private void UpdateCurrent(bool current, VisitedPage visited = null) { foreach (var visitedPage in VisitedPageList) { if (visited == null) { visitedPage.IsCurrent = current; } else if (visited == visitedPage) { visitedPage.IsCurrent = current; } } }
public void Add(VisitedPage visitedPage) { var lastPage = GetLast(); if (lastPage != null && lastPage == visitedPage) { return; } UpdateCurrent(false); if (visitedPage != null) { visitedPage.Id = GetIndex(); VisitedPageList.Add(visitedPage); } }
public VisitedPage GetPreviousMenuType() { var lastPage = GetLast(); if (lastPage != null) { Remove(lastPage); lastPage = GetLast(); } else { lastPage = new VisitedPage() { MenuType = MenuType.Logout, Id = GetIndex(), IsCurrent = true } }; return(lastPage); }