/// <summary> /// Changes the content of the listBox based on the <seealso cref="Models.History"/> class instance provided /// </summary> /// <param name="history"></param> public void PopulateListBox(Models.History history) { listBox.Items.Clear(); foreach (Models.HistoryItem historyItem in Controllers.HistoryController.GetListOfItemsFromHistory(history)) { listBox.Items.Add(String.Format("{0}\t{1}", historyItem.AccessDate, historyItem.Address)); } }
/// <summary> /// Method called when the sorting pattern of the input box has been changed. Calls the <seealso cref="Controllers.HistoryController.SortHistory(string)"/> method to sort the History according to this pattern and populates the ListBox with the newly sorted History /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SortingTextBox_TextChanged(object sender, EventArgs e) { Models.History history = this.HistoryController.SortHistory(this.sortingTextBox.Text); this.PopulateListBox(history); }