public static GreetingCard Create(User i_Receiver, eGreetingCardType i_CardType) { GreetingCard greetingCard = null; switch (i_CardType) { case eGreetingCardType.Birthday: { greetingCard = new BirthdayCard(i_Receiver); break; } case eGreetingCardType.Graduate: { greetingCard = new GraduateCard(i_Receiver); break; } case eGreetingCardType.Moving: { greetingCard = new MovingApartmentCard(i_Receiver); break; } } return(greetingCard); }
private void showGreetingCardPhoto(object sender, EventArgs e) { m_GreetingCard = GreetingCardFactory.Create(friendsListBox.SelectedItem as User, (eGreetingCardType)listBoxGreetingCardOptions.SelectedItem); m_GreetingCard.ShowGreetingCard(); m_GreetingCard.GreetingCardForm.ControlBox = false; saveGreetingCard(); m_GreetingCard.GreetingCardForm.ControlBox = true; postTheGreetingCardButton.Enabled = true; }