private Animal AddAnimal() { string name = txtName.Text; double age = Convert.ToDouble(txtAge.Text); CategoryType animalCategory = (CategoryType)lstCategory.SelectedIndex; Animal animalItem = null; switch (animalCategory) { case CategoryType.Bird: Bird.BirdSpecies birdSpecie = (Bird.BirdSpecies)Enum.Parse(typeof(Bird.BirdSpecies), lstCategory.SelectedItem.ToString()); animalItem = Bird.BirdFactory.CreateBird(birdSpecie); break; case.... etc.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)