private void button1_Click(object sender, EventArgs e) { FavoriteForm favoriteForm = new FavoriteForm(); if (favoriteForm.ShowDialog() == DialogResult.OK) { Favorite favorite = favoriteForm.Favorite; FavoriteManager.FavoritesManager.Favorites.Add(favorite); FavoriteManager.Save(); Render(); } }
private void editToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you really want to delete these favorites?", "Delete favorites", MessageBoxButtons.YesNo) == DialogResult.Yes) { foreach (ListViewItem item in listView1.SelectedItems) { Favorite favorite = (Favorite)item.Tag; FavoriteManager.FavoritesManager.Favorites.Remove(favorite); FavoriteManager.Save(); Render(); } } }
private void SaveFavorites() { FavoriteManager.Save(); }