コード例 #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //Create list of animals to be slected
            String[]      animals     = { "Cow", "Chicken", "Pig", "Guineafowl", "Sheep", "Goat", "Llama", "Alpaca", "Ostrich", "Emu", "Pigeon", "Dog", "Cat" };
            List <String> animalsList = new List <string>(animals);

            listBoxAnimal.DataSource = animalsList;

            //Create an animal repository
            animalRepository = new AnimalRepository();

            //Setting up dateTimePicker1 with proper format
            dateTimePicker1.Format       = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "MMM d, yyyy";
        }
コード例 #2
0
 public Form2(AnimalRepository inAnimalRepository)
 {
     InitializeComponent();
     animalRepository = inAnimalRepository;
 }