Inheritance: System.Windows.Forms.PictureBox
 private void 指定为对象ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (PointedOutCardPic != null)
     {
         if (CardPicClicked.Equals(PointedOutCardPic))
         {
             return;
         }
         PointedOutCardPic.Invalidate();
         PointedOutCardPic = null;
     }
     Card thisCard = ((CardPic)CardPicClicked).thisCard;
     if (thisCard != null)
     {
         List<string> temp = new List<string>();
         int num = thisCard.BelongedRegion().CardList.IndexOf(thisCard);
         if (thisCard.BelongedRegion().Equals(Player.FrontField))
         {
             temp.Add("SenderFront");
             PointedOutCardPic = FrontFieldCardPics[num];
         }
         else if (thisCard.BelongedRegion().Equals(Player.BackField))
         {
             temp.Add("SenderBack");
             PointedOutCardPic = BackFieldCardPics[num];
         }
         else if (thisCard.BelongedRegion().Equals(Rival.FrontField))
         {
             temp.Add("ReceiverFront");
             PointedOutCardPic = RivalFrontFieldCardPics[num];
         }
         else
         {
             temp.Add("ReceiverBack");
             PointedOutCardPic = RivalBackFieldCardPics[num];
         }
         BorderPainter = PointedOutCardPic.CreateGraphics();
         Rectangle rect = new Rectangle(PointedOutCardPic.ClientRectangle.X, PointedOutCardPic.ClientRectangle.Y,
                                          PointedOutCardPic.ClientRectangle.X + PointedOutCardPic.ClientRectangle.Width - 1,
                                          PointedOutCardPic.ClientRectangle.Y + PointedOutCardPic.ClientRectangle.Height - 1);
         BorderPainter.DrawRectangle(new Pen(Color.White, 6), rect);
         temp.Add(num.ToString());
         msgProcessor.SendSecret("PointOut", temp, "#将[" + GetRegionNameInString(thisCard.BelongedRegion()) + "][" + thisCard.UnitTitle + " " + thisCard.UnitName + "]指定为对象。");
     }
 }
 private void RivalSupportCardPicRenew()
 {
     if (this.Controls.Contains(RivalSupportCardPic))
     {
         this.Controls.Remove(RivalSupportCardPic);
         RivalSupportCardPic.Dispose();
     }
     if (Rival.Support.CardList.Count > 0)
     {
         RivalSupportCardPic = new CardPic(Rival.Support.CardList[Rival.Support.CardList.Count - 1], "RivalSupport");
         RivalSupportCardPic.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
         RivalSupportCardPic.Location = new Point(9, 248);
         RivalSupportCardPic.MouseClick += new MouseEventHandler(Card_MouseClick);
         this.Controls.Add(RivalSupportCardPic);
         RivalSupportCardPic.BringToFront();
     }
 }
 private void SupportCardPicRenew()
 {
     if (this.Controls.Contains(SupportCardPic))
     {
         this.Controls.Remove(SupportCardPic);
         SupportCardPic.Dispose();
     }
     if (Player.Support.CardList.Count > 0)
     {
         SupportCardPic = new CardPic(Player.Support.CardList[Player.Support.CardList.Count - 1], "Support");
         SupportCardPic.Location = new Point(522, 359);
         SupportCardPic.ContextMenuStrip = contextMenuStrip_Card;
         SupportCardPic.MouseClick += new MouseEventHandler(Card_MouseClick);
         SupportCardPic.MouseDown += new MouseEventHandler(Card_MouseDown);
         this.Controls.Add(SupportCardPic);
         SupportCardPic.BringToFront();
     }
 }
 private void RivalGraveCardPicRenew()
 {
     if (this.Controls.Contains(RivalGraveCardPic))
     {
         this.Controls.Remove(RivalGraveCardPic);
         RivalGraveCardPic.Dispose();
     }
     if (Rival.Grave.CardList.Count > 0)
     {
         RivalGraveCardPic = new CardPic(Rival.Grave.CardList[Rival.Grave.CardList.Count - 1], "RivalGrave");
         RivalGraveCardPic.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
         RivalGraveCardPic.Location = new Point(9, 7);
         RivalGraveCardPic.ContextMenuStrip = contextMenuStrip_RivalCard;
         RivalGraveCardPic.MouseClick += new MouseEventHandler(Card_MouseClick);
         RivalGraveCardPic.MouseDown += new MouseEventHandler(Card_MouseDown);
         RivalGraveCardPic.MouseDoubleClick += new MouseEventHandler(RivalGrave_MouseDoubleClick);
         this.Controls.Add(RivalGraveCardPic);
         RivalGraveCardPic.BringToFront();
     }
 }
 private void RivalDeckCardPicRenew()
 {
     if (this.Controls.Contains(RivalDeckCardPic))
     {
         this.Controls.Remove(RivalDeckCardPic);
         RivalDeckCardPic.Dispose();
     }
     if (Rival.Deck.CardNum > 0)
     {
         if (Rival.Deck.CardList[0].SerialNo == -1)
         {
             RivalDeckCardPic = new CardPic("RivalDeck");
             RivalDeckCardPic.ReverseToBack();
         }
         else
         {
             RivalDeckCardPic = new CardPic(Rival.Deck.CardList[0], "RivalDeck");
         }
         RivalDeckCardPic.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
         RivalDeckCardPic.Location = new Point(9, 131);
         RivalDeckCardPic.ContextMenuStrip = contextMenuStrip_RivalCard;
         RivalDeckCardPic.MouseClick += new MouseEventHandler(Card_MouseClick);
         RivalDeckCardPic.MouseDown += new MouseEventHandler(Card_MouseDown);
         this.Controls.Add(RivalDeckCardPic);
         RivalDeckCardPic.BringToFront();
     }
 }
 private void GraveCardPicRenew()
 {
     if (this.Controls.Contains(GraveCardPic))
     {
         this.Controls.Remove(GraveCardPic);
         GraveCardPic.Dispose();
     }
     if (Player.Grave.CardList.Count > 0)
     {
         GraveCardPic = new CardPic(Player.Grave.CardList[Player.Grave.CardList.Count - 1], "Grave");
         GraveCardPic.Location = new Point(522, 602);
         GraveCardPic.ContextMenuStrip = contextMenuStrip_Card;
         GraveCardPic.MouseClick += new MouseEventHandler(Card_MouseClick);
         GraveCardPic.MouseDown += new MouseEventHandler(Card_MouseDown);
         GraveCardPic.MouseDoubleClick += new MouseEventHandler(Grave_MouseDoubleClick);
         this.Controls.Add(GraveCardPic);
         GraveCardPic.BringToFront();
     }
 }
 private void DeckCardPicRenew()
 {
     if (this.Controls.Contains(DeckCardPic))
     {
         this.Controls.Remove(DeckCardPic);
         DeckCardPic.Dispose();
     }
     if (Player.Deck.CardList.Count > 0)
     {
         DeckCardPic = new CardPic(Player.Deck.CardList[0], "Deck");
         DeckCardPic.Location = new Point(522, 478);
         if (!DeckCardPic.FrontShown)
         {
             DeckCardPic.ReverseToBack();
         }
         DeckCardPic.ContextMenuStrip = contextMenuStrip_Card;
         DeckCardPic.MouseDown += new MouseEventHandler(Card_MouseDown);
         DeckCardPic.MouseClick += new MouseEventHandler(Card_MouseClick);
         DeckCardPic.MouseDoubleClick += new MouseEventHandler(Deck_MouseDoubleClick);
         this.Controls.Add(DeckCardPic);
         DeckCardPic.BringToFront();
     }
 }
Beispiel #8
0
 private void DeckCardPicRenew()
 {
     if (GameOn || WatchingMode)
     {
         label_DeckLabel.Visible = true;
         label_DeckLabel.Text = LabelDeckTotalString + Player.Deck.CardList.Count.ToString();
         if (Player.Deck.CardList.Count <= 10)
         {
             label_DeckLabel.ForeColor = Color.Red;
         }
         else
         {
             label_DeckLabel.ForeColor = Color.Black;
         }
     }
     if (Controls.Contains(DeckCardPic))
     {
         Controls.Remove(DeckCardPic);
         DeckCardPic.Dispose();
     }
     if (Player.Deck.CardList.Count > 0)
     {
         DeckCardPic = new CardPic(Player.Deck.CardList[0], "Deck", this);
         DeckCardPic.Location = new Point(522, 478);
         if (!DeckCardPic.FrontShown)
         {
             DeckCardPic.ReverseToBack();
         }
         if (!WatchingMode)
         {
             DeckCardPic.MouseDoubleClick += new MouseEventHandler(Deck_MouseDoubleClick);
         }
         DeckCardPic.ContextMenuStrip = contextMenuStrip_Card;
         DeckCardPic.MouseDown += new MouseEventHandler(Card_MouseDown);
         DeckCardPic.MouseClick += new MouseEventHandler(Card_MouseClick);
         Controls.Add(DeckCardPic);
         DeckCardPic.BringToFront();
     }
 }