Beispiel #1
0
 public CookDetailView(MabiCooker Main, CookData Exchange, ListBox FavView)
 {
     InitializeComponent();
     this.MainWindow = Main;
     this.CookInfo = Exchange;
     this.FavListView = FavView;
     UpdateData(this.CookInfo);
 }
Beispiel #2
0
        public void UpdateData(CookData Exchange)
        {
            // Initialize Text
            lStuffOne.Text = "";
            lStuffOnePrice.Text = "";
            lStuffTwo.Text = "";
            lStuffTwoPrice.Text = "";
            lStuffThree.Text = "";
            lStuffThreePrice.Text = "";
            lStuffThree.Visible = false;

            try
            {
                this.CookInfo = Exchange;
                bBack.Enabled = (this.ForTrace.Count == 0) ? false : true; // 이전 요리 스택에 뭔가 있으면 버튼 활성화
                this.Text = CookInfo.cook.getName();

                if (CookInfo.stuffs[0] != null)
                {
                    lStuffOne.Text = CookInfo.stuffs[0].sName;
                    CheckStuff(CookInfo.stuffs[0], lStuffOne, lStuffOnePrice);
                }
                else
                {
                    lStuffOne.Text = "Unknown Error";
                }

                if (CookInfo.stuffs[1] != null)
                {
                    lStuffTwo.Text = CookInfo.stuffs[1].sName;
                    CheckStuff(CookInfo.stuffs[1], lStuffTwo, lStuffTwoPrice);
                }
                else
                {
                    lStuffTwo.Text = "Unknown Error";
                }

                if ((CookInfo.cook.getRatio())[0] == 230)
                {
                    this.Text += Properties.Resources.StrCannotCook;
                }
                if (CookInfo.stuffs[2] != null)
                {
                    lStuffThree.Text = CookInfo.stuffs[2].sName;
                    CheckStuff(CookInfo.stuffs[2], lStuffThree, lStuffThreePrice);
                    lStuffThree.Visible = true;

                }
                else
                {
                    lStuffThree.Text = "Unknown Error";
                }

                bModFav_Icon();
                lEffects.Text = CookInfo.cook.getEffect();
                var RankId = CookInfo.cook.getRank();

                lRank.Text = RankId.ToString();
                lPicture.Image = CookImplement.Rank.getRankBitmap(RankId);
                this.message = CookImplement.Rank.getRankName(RankId);
                lMessage.Text = this.message;
            }
            catch (IndexOutOfRangeException e)
            {
                CookImplement.Dialog.ErrorDialog error = new CookImplement.Dialog.ErrorDialog(null, e.StackTrace);
                error.ShowDialog();
            }
        }
Beispiel #3
0
 private void bBack_Click(object sender, EventArgs e)
 {
     if (ForTrace.Count != 0)
     {
         CookInfo = ForTrace.Pop();
         UpdateData(CookInfo);
         CookRatioView.SelectedCook = CookInfo.cook;
         CookRatioView.DataIndex = CookInfo.cIndex;
         if (MabiCooker.RatioView != null) MabiCooker.RatioView.UpdateData();
         if (ForTrace.Count == 0) bBack.Enabled = false;
     }
 }