Exemplo n.º 1
0
 private void bModFav_Click(object sender, EventArgs e)
 {
     if (MainWindow.FavList.Contains(CookInfo.cIndex))
     {
         MainWindow.DeleteFavList(CookInfo.cIndex);
         MainWindow.UpdateData(MainWindow.FavList, FavListView);
         if (MabiCooker.RatioView != null)
         {
             MabiCooker.RatioView.UpdateData();
         }
         pAlertShowing.BackColor = SystemColors.InactiveCaption;
         lMessage.Text           = Properties.Resources.MsgFavoriteRemove;
         tiCheckAlert.Enabled    = true;
     }
     else
     {
         MainWindow.AddFavList(CookInfo.cIndex);
         MainWindow.UpdateData(MainWindow.FavList, FavListView);
         if (MabiCooker.RatioView != null)
         {
             MabiCooker.RatioView.UpdateData();
         }
         pAlertShowing.BackColor = SystemColors.ActiveCaption;
         lMessage.Text           = Properties.Resources.MsgFavoriteAdd;
         tiCheckAlert.Enabled    = true;
     }
     bModFav_Icon();
 }
Exemplo n.º 2
0
 private void lFavCheck_Click(object sender, EventArgs e)
 {
     if (MainWindow.FavList.Contains(DataIndex) == false)
     {
         MainWindow.AddFavList(DataIndex);
     }
     else
     {
         MainWindow.DeleteFavList(DataIndex);
     }
     lFavCheck_Icon(true);
     MainWindow.UpdateData(MainWindow.FavList, FavListView);
     if (MabiCooker.DetailView != null)
     {
         MabiCooker.DetailView.UpdateData(DataIndex, SelectedCook);
     }
     if (MainWindow.FavList.Count != 0)
     {
         FavListView.BringToFront();
     }
     else
     {
         FavListView.SendToBack();
     }
 }