private void bPrintRatio_Click(object sender, EventArgs e) { if (tcMainCtrl.SelectedIndex != -1) { if (RatioView == null) { RatioView = new CookRatioView(this, lbFavResult); if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } else { if (RatioView.Visible == true) { RatioView.Visible = false; } else { if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } } } }
private void bPrintRatio_Click(object sender, EventArgs e) { if (tcMainCtrl.SelectedIndex != -1) { if (RatioView == null) { RatioView = new CookRatioView(this, lbFavResult); if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } else { if (RatioView.Visible == true) RatioView.Visible = false; else { if (tcMainCtrl.SelectedIndex == 0) { CookRatioView.SelectedCook = CookData[SelectedRank[lbRankResult.SelectedIndex]]; CookRatioView.DataIndex = SelectedRank[lbRankResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 1) { CookRatioView.SelectedCook = CookData[SearchResult[lbSearchResult.SelectedIndex]]; CookRatioView.DataIndex = SearchResult[lbSearchResult.SelectedIndex]; } else if (tcMainCtrl.SelectedIndex == 2) { CookRatioView.SelectedCook = CookData[FavList[lbFavResult.SelectedIndex]]; CookRatioView.DataIndex = FavList[lbFavResult.SelectedIndex]; } RatioView.UpdateData(); RatioView.Activate(); } } } }