예제 #1
0
        public static void PrintThisType(string type)
        {
            PrintThisType print = new PrintThisType();

            foreach (object animal in animals)
            {
                switch (type)
                {
                case "Животное":
                    if (animal is KingdomAnimal)
                    {
                        print.Output(animal as KingdomAnimal);
                    }
                    break;

                case "Млекопитающее":
                    if (animal is ClassMammals)
                    {
                        print.Output(animal as ClassMammals);
                    }
                    break;

                case "Птица":
                    if (animal is ClassBirds)
                    {
                        print.Output(animal as ClassBirds);
                    }
                    break;

                case "Парнокопытное":
                    if (animal is OrderArtiodactyl)
                    {
                        print.Output(animal as OrderArtiodactyl);
                    }
                    break;
                }
            }
        }
예제 #2
0
        private void ПечатьЭлементовДанногоТипаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PrintThisType form = new PrintThisType();

            form.ShowDialog();
        }
예제 #3
0
        private void ПечатьОсобейДанногоВидаToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PrintThisType form = new PrintThisType();

            form.ShowDialog();
        }