I am making an animal shelter application, in which I have to create either a cat or a dog, and by creating it and adding it to a list. I have a button that is supposed to show all the animals of the list, and another button supposed to show all the dogs. When I click one those two buttons, only the last created animal appears. Can you give me some guidance?

```
    namespace AnimalShelter
    {
    class AnimalShelter
    {
    private string Name;
    private int TelNumber;
    private List<Animal> AnimalList;

    public AnimalShelter(string name, int telnumber)
    {
        this.AnimalList = new List<Animal>();
        this.Name = name;
        this.TelNumber = telnumber;
    }

    public Animal FindAnimal(string id)
    {
        foreach (Animal anim in this.AnimalList)
        {
            if (id == anim.ChipRegistrationNumber)
            {
                return anim;
            }
        }
        return null;
    }

    public bool RemoveAnimal(string id)
    {
        if (id.Length <= 0)
            return false;
        Animal ao = this.FindAnimal(id);
        if (ao == null)
            return false;
        this.AnimalList.Remove(ao);
        return true;
    }

    public bool AddNewAnimal(Animal ao)
    {
        if (ao == null)
            return false;

        if (this.FindAnimal(ao.ChipRegistrationNumber) != null)
            return false;

        this.AnimalList.Add(ao);

        return true;
    }

    public List<Dog> GetAllDogs()
    {
       List<Dog> temp = new List<Dog>();
       foreach (Animal animal in this.AnimalList)
       {
           if (animal.GetType() == typeof(Dog))
               temp.Add((Dog)animal);

       }
       return temp;
    }

    public List<Cat> GetAllCats()
    {
        List<Cat> temp = new List<Cat>();
        foreach (Animal animal in this.AnimalList)
        {
            if (animal.GetType() == typeof(Cat))
                temp.Add((Cat)animal);
        }
        return temp;
    }

    public List<Animal> GetAllAnimals()
    {
        return AnimalList;
    }

    }
}

```

And this is the actual form, in which I create the cat or dog, and have the buttons to show all animals, or to show all dogs!

```
   private void AnimalCreation_Click_1(object sender, EventArgs e)
    {
        string name = tbname.Text;
        string number = tbregno.Text;
        DateTime date = this.DateBroughtIn.Value.Date;
        DateTime lastwalked = this.LastWalked.Value.Date;
        string badhabits = tbbadhabbits.Text;

        if (name.Length <= 0)
        {
            MessageBox.Show("A Name Must Be Given");
        }

        if (number.Length <= 0)
        {
            MessageBox.Show(" A number must be given ");
        }

        if (date > DateTime.Now)
        {
            MessageBox.Show("Invalid date, can not be added");
        }
        else
        {
            Animal a = null;
            if (dog.Checked)
            {

                a = new Dog(number, date, name, lastwalked);
                this.MyAnimalShelter.AddNewAnimal(a);
                MessageBox.Show("Dog Successfully added");
            }
            if (cat.Checked)
            {
                if (badhabits.Length <= 0)
                {
                    MessageBox.Show("Bad Habbits must be filled");
                }
                else
                {
                    a = new Cat(number, date, name, badhabits);
                    this.MyAnimalShelter.AddNewAnimal(a);
                    MessageBox.Show("Cat Successfully added");
                }
            }

        }
    }

    private void AllAnimalsShow_Click(object sender, EventArgs e)
    {
        foreach (Animal animal in MyAnimalShelter.GetAllAnimals())
        {
            listBox1.Items.Clear();
            listBox1.Items.Add(animal);
        }
    }

    private void AllDogsShow_Click_1(object sender, EventArgs e)
    {
        foreach (Animal animal in MyAnimalShelter.GetAllDogs())
        {
            listBox1.Items.Clear();
            listBox1.Items.Add(animal);
        }
    }

```