/// <summary> /// Returns the previous site and adds the current site to the /// next sites stack. /// </summary> /// <param name="currentSite">The current site of the browser</param> /// <returns>Previously visited site</returns> public string ReturnPreviousSite(string currentSite) { string previousSite = PreviousSites.Pop(); NextSites.Push(currentSite); return(previousSite); }
/// <summary> /// Returns the next site and adds the current site to the /// previous sites stack. /// </summary> /// <param name="currentSite">The current site of the browser</param> /// <returns>Last visited site before pressing "Previous"</returns> public string ReturnNextSite(string currentSite) { string nextSite = NextSites.Pop(); PreviousSites.Push(currentSite); return(nextSite); }
public void AddMostRecentlyUsedSite(string site) { var sites = new StringCollection { site }; if (PreviousSites != null) { sites.AddRange(PreviousSites.OfType <string>().Where(x => x != site).ToArray()); } PreviousSites = sites; }
/// <summary> /// Add a site to the URL list as well as the previous sites stack. /// </summary> /// <param name="url">Site to be added</param> public void AddNewSite(string url) { AddSiteToList(url); PreviousSites.Push(url); }