Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();

            Animals = new ObservableCollection <Animal>();

            // define some animals
            Frog frog = new Frog(4, "Kermit", false, 2.33);
            Dog  dog  = new Dog("Muppet", 20, "Rolf", 4.5);
            Duck duck = new Duck(9, "Donald", 5.3);
            Cat  cat  = new Cat("Siamese", 15, "Clorie", 2.5);

            Animals.Add(frog);
            Animals.Add(duck);
            Animals.Add(dog);
            Animals.Add(cat);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();
            Animals = new ObservableCollection <Animal>();
            // Instantiate some dog objects
            Dog dog1 = new Dog("Muppet", 20, "Rolf");
            Dog dog2 = new Dog("Golden Retriever", 30, "Air Bud");
            // Ducks and Frogs
            Duck duck1 = new Duck(9, "Donald");
            Frog frog1 = new Frog(4, "Kermit", false);

            // Add the dogs to the list
            Animals.Add(dog1);
            Animals.Add(dog2);
            Animals.Add(duck1);
            Animals.Add(frog1);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();
            Animals = new ObservableCollection <Animal>();

            // make some animals

            Frog   frog = new Frog(4, "Frug", true, 4000);
            Dog    dog  = new Dog("Labradoodle", 35, "dug", 8300000);
            Duck   duck = new Duck(4, "poop", 3);
            Animal bruh = new Duck(500, "u suck", 40);

            Animals.Add(frog);
            Animals.Add(dog);
            Animals.Add(duck);
            Animals.Add(bruh);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 4
0
        public MainWindow()
        {
            InitializeComponent();
            Animals = new ObservableCollection <Animal>();
            Frog frog  = new Frog(4, "Kermit", false, 12);
            Duck duck  = new Duck(10, "Donald", 13);
            Dog  dog   = new Dog("Rapper", 10, "Snoop Dawg", 24);
            Dog  dog2  = new Dog("Big Red Dog", 200, "Clifford", 1000);
            Duck duck2 = new PolymorphismIntro.Duck(12, "Daffy", 23);
            Frog frog2 = new PolymorphismIntro.Frog(3, "Jeremiah", true, 15);

            Animals.Add(frog);
            Animals.Add(duck);
            Animals.Add(dog);
            Animals.Add(frog2);
            Animals.Add(duck2);
            Animals.Add(dog2);
            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 5
0
        public MainWindow()
        {
            InitializeComponent();
            Animals = new ObservableCollection <Animal>();
            Frog frog  = new Frog(4, "Kermit", false, 100);
            Dog  dog   = new Dog("Muppet", 20, "Rolf", 150);
            Duck duck  = new Duck(9, "Donald", 1200000);
            Dog  dogs  = new Dog("red boy", 200, "Clifford", 1000);
            Duck ducks = new Duck(5, "Daffy", 60);
            Frog frogs = new Frog(3, "Jeremiah", false, 15);

            Animals.Add(frog);
            Animals.Add(dog);
            Animals.Add(duck);
            Animals.Add(dogs);
            Animals.Add(frogs);
            Animals.Add(ducks);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 6
0
        public MainWindow()
        {
            InitializeComponent();
            Animals = new ObservableCollection <Animal>();

            Dog  dog1  = new Dog("Muppet", 20, "Rolf");
            Dog  dog2  = new Dog("Golden Retriever", 30, "Air Bud");
            Duck duck1 = new Duck(9, "Donald");

            Frog frog1 = new Frog(4, "Kermit", false);

            duck1.SayName();
            frog1.SayName();

            Animals.Add(dog1);
            Animals.Add(dog2);
            Animals.Add(duck1);
            Animals.Add(frog1);

            LvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 7
0
        public MainWindow()
        {
            InitializeComponent();
            Animals = new ObservableCollection <Animal>();

            // make siome aminals
            Frog frog  = new Frog(4, "Bart", true, 1);
            Dog  dog   = new Dog("Labradoodle", 35, "Pax", 100000);
            Duck duck  = new Duck(4, "Moo", 8);
            Dog  dog2  = new Dog("thing", 200, "Clifford", 1000);
            Duck duck2 = new Duck(5, "Jeremiah", 60);
            Frog frog2 = new Frog(3, "Daffy", true, 15);

            Animals.Add(frog);
            Animals.Add(dog);
            Animals.Add(duck);
            Animals.Add(frog2);
            Animals.Add(dog2);
            Animals.Add(duck2);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 8
0
        public MainWindow()
        {
            InitializeComponent();

            Animals = new ObservableCollection <Animal>();

            Frog frog = new Frog(4, "Kermit", false, 2);
            Duck duck = new Duck(10, "Donald", 25);
            Dog  dog  = new Dog("Labradoodle", 15, "Pax", 45);
            Dog  Dog  = new Dog("Vizsla", 200, "Clifford", 1000);
            Duck Duck = new Duck(5, "Daffy", 60);
            Frog Frog = new Frog(4, "Jeremiah", true, 15);

            Animals.Add(frog);
            Animals.Add(duck);
            Animals.Add(dog);
            Animals.Add(Dog);
            Animals.Add(Duck);
            Animals.Add(Frog);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 9
0
        public MainWindow()
        {
            InitializeComponent();
            Animals = new ObservableCollection <Animal>();

            // Define some animals
            Frog frog  = new Frog(4, "Kermit", false, 8);
            Dog  dog   = new Dog("Muppet", 20, "Rolf", 24);
            Duck duck  = new Duck(9, "Donald", 15);
            Dog  dog2  = new Dog("Mutt", 200, "Clifford", 1000);
            Duck duck2 = new Duck(5, "Daffy", 60);
            Frog frog2 = new Frog(3, "Jeremiah", false, 15);

            // Add the animals to the list
            Animals.Add(frog);
            Animals.Add(dog);
            Animals.Add(duck);
            Animals.Add(frog2);
            Animals.Add(dog2);
            Animals.Add(duck2);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 10
0
        public MainWindow()
        {
            InitializeComponent();

            Animals = new ObservableCollection <Animal>();

            Frog frog = new Frog(3, "Kermit", false, 1);
            Dog  dog  = new Dog("Rapper", 6, "Snoop", 150);
            Duck duck = new Duck(5, "Donald", 120);

            Animals.Add(frog);
            Animals.Add(dog);
            Animals.Add(duck);

            Frog jeremiah = new Frog(3, "Jeremiah", false, 2);
            Dog  clifford = new Dog("Big Red Dog", 25, "Clifford", 174000);
            Duck daffy    = new Duck(4, "Daffy", 150);

            Animals.Add(jeremiah);
            Animals.Add(daffy);
            Animals.Add(clifford);

            lvAnimals.ItemsSource = Animals;
        }
        public MainWindow()
        {
            InitializeComponent();
            Animals = new List <Animal>();
            Frog frog     = new PolymorphismIntro.Frog(4, "Kermit", false, 25);
            Dog  dog      = new PolymorphismIntro.Dog("Muppet", 20, "Rolf", 70);
            Duck duck     = new Duck(9, "Donald", 35);
            Dog  Clifford = new PolymorphismIntro.Dog("terrier", 200, "Clifford", 1000);
            Duck Daffy    = new Duck(5, "Daffy", 60);
            Frog Jerimiah = new Frog(3, "Jerimiah", true, 15);

            Animals.Add(frog);
            Animals.Add(dog);
            Animals.Add(duck);
            Animals.Add(Clifford);
            Animals.Add(Daffy);
            Animals.Add(Jerimiah);
            lvAnimals.ItemsSource = Animals;

            foreach (Animal a in Animals)
            {
                a.SayName();
            }
        }
Ejemplo n.º 12
0
        public MainWindow()
        {
            InitializeComponent();

            Animals = new ObservableCollection <Animal>();

            Frog frog = new Frog(4, "Kermit", 0.2f, true);
            Duck duck = new Duck(10, "Donald", 5f);
            Dog  dog  = new Dog("Rapper", 10, "Snoop", 20f);

            Animals.Add(frog);
            Animals.Add(duck);
            Animals.Add(dog);

            frog = new Frog(3, "Jeremiah", 3f, true);
            duck = new Duck(5, "Daffy", 60f);
            dog  = new Dog("Rapper", 200, "Clifford", 1000f);

            Animals.Add(frog);
            Animals.Add(duck);
            Animals.Add(dog);

            lvAnimals.ItemsSource = Animals;
        }
Ejemplo n.º 13
0
        private void Ribbit_Button_Click(object sender, RoutedEventArgs e)
        {
            Frog frog = new Frog();

            frog.Ribbit();
        }