示例#1
0
        /// <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);
        }
示例#2
0
        /// <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);
        }
示例#3
0
        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;
        }
示例#4
0
 /// <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);
 }