Exemplo n.º 1
0
        public HistoryPanelPresenter(IHistoryPanelView view, GlobalHistory history)
        {
            this.view    = view;
            this.history = history;

            this.view.UpdateHistoryEntries(history.Entries);

            this.view.HistoryWipedEvent          += this.HistoryWipedEventHandler;
            this.view.HistoryEntriesDeletedEvent += this.HistoryEntriesDeletedEventHandler;

            this.view.ViewClosedEvent += (s, e) => this.ViewClosedEvent(this, EventArgs.Empty);
            this.view.JumpAskedEvent  += (s, e) => this.JumpAskedEvent(this, e);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a url to the user's history
        /// </summary>
        /// <param name="url">The url to be added to the user's history</param>
        private void AddToHistory(string url)
        {
            DateTime now = DateTime.Now;

            localHistory.Add(url);
            localHistoryPosition = localHistory.Count() - 1; //If we go to a new website we want the counter to be at the end of the list
            GlobalHistory.Add(new KeyValuePair <string, string>(url, now.ToString()));
            using (StreamWriter sw = File.AppendText(historyFileName))
            {
                sw.WriteLine(url + "," + now);
            }
            //TODO: Remove web pages ahead in history if we go to a page when not on the most recent
        }
Exemplo n.º 3
0
 public UserProfile(GlobalHistory history, Uri homePage, FavoritesRepository favorites)
 {
     this.History   = history;
     this.HomePage  = homePage;
     this.Favorites = favorites;
 }