private void Add() { var newEntry = new Entry(destinationText.Text, redirectingText.Text, true); this.SetDefaultInput(); this.fileIO.Entries.Add(newEntry); this.fileIO.WriteEntriesToFile(); this.UpdateLists(); }
private void DeleteFromList(ListBox.SelectedObjectCollection searchItems, Entry searchEntry) { for (int i = 0; i < searchItems.Count; i++) { var entry = (Entry) searchItems[i]; if (entry.EqualToEntry(searchEntry)) { this.fileIO.Entries.Remove(entry); return; } } }
public bool EqualToEntry(Entry compare) { return ((compare.Destination == this.Destination) && (compare.Redirecting == this.Redirecting)); }