public Card(int value) { int suit = value / 13; _suit = (Cards.Suit)suit; _denom = value - suit * 13; Source = Cards.GetCard(_suit, _denom); Height = MainWindow._hghtCard; }
static string ToString(Cards.Suit suit) { switch (suit.Tag) { case Cards.Suit.Tags.Clubs: return("C"); case Cards.Suit.Tags.Diamonds: return("D"); case Cards.Suit.Tags.Hearts: return("H"); case Cards.Suit.Tags.Spades: return("S"); default: return("?"); } }
public Card(int value) { cvalue = value; int suit = value / 13; _suit = (Cards.Suit)suit; _denom = value - suit * 13; Source = Cards.GetCard(_suit, _denom); Height = MainWindow._hghtCard; AllowDrop = true; this.MouseDown += (o, e) => { this.xdrag = value; DragDrop.DoDragDrop(this, this, DragDropEffects.Move); }; }