Esempio n. 1
0
File: Form1.cs Progetto: rNdm74/C-
        private void displayQueryResult(string species)
        {
            // Trim 's' from the string
            string key = species.TrimEnd(TRIM_CHAR);

            // Populate list of selected animals
            List <Animal> animalsQuery = db.Search(key);

            // Determines how many animals in selection
            if (animalsQuery.Count > ANIMAL_LIMIT)
            {
                // Display listbox
                displayAnimals = new DisplayText(lbPets);
            }
            else
            {
                // Display pictureboxes
                displayAnimals = new DisplayPicture(pbPets);
            }

            // Display
            displayAnimals.display(animalsQuery);
        }
Esempio n. 2
0
File: Form1.cs Progetto: rNdm74/C-
        private void displayQueryResult(string species)
        {
            // Trim 's' from the string
            string key = species.TrimEnd(TRIM_CHAR);

            // Populate list of selected animals
            List<Animal> animalsQuery = db.Search(key);

            // Determines how many animals in selection
            if (animalsQuery.Count > ANIMAL_LIMIT)
            {
                // Display listbox
                displayAnimals = new DisplayText(lbPets);
            }
            else
            {
                // Display pictureboxes
                displayAnimals = new DisplayPicture(pbPets);
            }

            // Display
            displayAnimals.display(animalsQuery);
        }