private void AddFavourites_Click(object sender, EventArgs e) { // Add entry and write to file try { favourites.AddEntry(content.Url, content.Title, true); } catch (ArgumentException) { MessageBox.Show("A favourite with this title already exists.\n Try to add a custom favourite with a new name", "Add Favourites Error"); } }
private void OkBtn_Click(object sender, EventArgs e) { // Add entry and write to file try { fav.AddEntry(UrlTextBox.Text, TitleTextBox.Text, true); Close(); } catch (Exception) { MessageBox.Show("A favourite with this title already exists.\n Try to add a custom favourite with a new name", "Add Favourites Error"); } }