示例#1
0
        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();
            }
        }
示例#2
0
 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();
         }
     }
 }
示例#3
0
 private void SaveFavorites()
 {
     FavoriteManager.Save();
 }