Пример #1
0
Файл: Form1.cs Проект: 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);
        }
Пример #2
0
Файл: Form1.cs Проект: 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);
        }