public VMCard(Model.Card.POSITIONS position, Model.Card.SUITS suit) { if (position == Model.Card.POSITIONS.Blank || suit == Model.Card.SUITS.Blank) { this.ImageSource = new Uri(Environment.CurrentDirectory + Properties.Settings.Default.cardImagesDirectory + BLANK_CARD_PATH); } else if (position == Model.Card.POSITIONS.Unknown || suit == Model.Card.SUITS.Unknown) { this.ImageSource = new Uri(Environment.CurrentDirectory + Properties.Settings.Default.cardImagesDirectory + BACKSIDE_CARD_PATH); } else { this.ImageSource = new Uri(Environment.CurrentDirectory + Properties.Settings.Default.cardImagesDirectory + POSITIONS_DICTIONARY[position] + POS_SUIT_SPLIT + SUITS_DICTIONARY[suit] + EXTENSION); } this.position = position; this.suit = suit; }
/// <summary> /// Creates a VMCard instance with the default, blank image. /// </summary> public VMCard() { this.ImageSource = new Uri(Environment.CurrentDirectory + Properties.Settings.Default.cardImagesDirectory + BLANK_CARD_PATH); this.position = Model.Card.POSITIONS.Blank; this.suit = Model.Card.SUITS.Blank; }