Пример #1
0
        private void frmMainForm_Load(object sender, EventArgs e)
        {
            PlayingCard theCard = new CardBoxLib.PlayingCard(Rank.Ace, Suit.Clubs);

            theCard.FaceUp        = true;
            this.cbxTestCard.Card = theCard;
        }
Пример #2
0
        public virtual int CompareTo(object obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException("Unable to compare a Card to a null object.");
            }

            PlayingCard compareCard = obj as PlayingCard;

            if (compareCard != null)
            {
                int thisSort        = this.myValue * 10 + (int)this.mySuit;
                int compareCardSort = compareCard.myValue * 10 + (int)compareCard.mySuit;
                return(thisSort.CompareTo(compareCardSort));
            }
            else
            {
                throw new ArgumentException("Object being compared cannot be converted to a Card.");
            }
        }