Exemple #1
0
 private void ShowDardImage(ListCardTotal card)
 {
     string imagePath = Path.Combine(UtilityHelper.ApplicationPath,
                                         string.Format("{2}\\{0}\\{1}",
                                                       card.Symbol,
                                                       card.CardImage,
                                                       DefaultDirectoryName.CardPictures));
     if (File.Exists(imagePath))
     {
         pbxCardImage.Image = Image.FromFile(imagePath);
     }
     else
     {
         // 这里还需要加入根据卡牌信息生成自定义画像
     }
 }
Exemple #2
0
 public void SelectCard(ListCardTotal card)
 {
     int cardIndex = GetCardIndexOfTotalGridView(card.CardID);
     SelectRowAtIndex(cardIndex);
 }
Exemple #3
0
 private void UnPackInstanceToComponent(ListCardTotal card)
 {
     this.ActiveCard = card;
     cbxExpansions.Text = card.Symbol;
     tbxCollectorNumber.Text = card.CollectorNumber.ToString();
     tbxCardName.Text = card.CardName;
     tbxCardEnglishName.Text = card.CardEnglishName;
     tbxAbilitiesText.Text = card.Abilities;
     tbxAbilities.Text = ((FormMain)this.Owner).Cards.GetAbilities(card.CardID);
     tbxFlavorText.Text = card.FlavorText;
     tbxManaCost.Text = card.ManaCost;
     cbxCardType.Text = card.TypeName;
     tbxCardSubType.Text = card.SubTypeName;
     tbxPower.Text = card.Power.ToString();
     tbxToughness.Text = card.Toughness.ToString();
     cbxRarity.SelectedValue = card.Rarity;
     cbxPainterName.Text = card.PainterName;
     tbxCardPrice.Text = card.CardPrice.ToString("0.00");
     tbxFAQ.Text = card.FAQ;
     tbxCardImage.Text = card.CardImage;
     LoadCardImage(card.CardImage);
 }
Exemple #4
0
 public void ShowCardInfo(ListCardTotal card)
 {
     UnPackInstanceToComponent(card);
 }
Exemple #5
0
 /// <summary>
 /// 将当前界面中的数据封装成一个对象
 /// </summary>
 /// <returns></returns>
 private ListCardTotal PackageComponentToInstance()
 {
     ListCardTotal result = new ListCardTotal();
     if (CheckInput())
     {
         result.CardID = this.ActiveCard == null ? 0 : this.ActiveCard.CardID;
         result.Symbol = cbxExpansions.Text;
         result.CollectorNumber = Convert.ToInt32(tbxCollectorNumber.Text);
         result.CardName = tbxCardName.Text;
         result.CardEnglishName = tbxCardEnglishName.Text;
         result.Abilities = tbxAbilitiesText.Text;
         result.FlavorText = tbxFlavorText.Text;
         result.ManaCost = tbxManaCost.Text;
         result.TypeName = cbxCardType.Text;
         result.SubTypeName = tbxCardSubType.Text;
         result.Power = Convert.ToInt32(tbxPower.Text);
         result.Toughness = Convert.ToInt32(tbxToughness.Text);
         result.Rarity = Convert.ToInt32(cbxRarity.SelectedValue);
         result.PainterName = cbxPainterName.Text;
         result.CardPrice = Convert.ToDouble(tbxCardPrice.Text);
         result.FAQ = tbxFAQ.Text;
         result.CardImage = SaveCardImage(tbxCardImage.Text);
         if (string.IsNullOrEmpty(result.CardImage))
         {
             result = null;
         }
     }
     return result;
 }