示例#1
0
文件: Program.cs 项目: Yelmic/Lab6
        static void Main(string[] args)
        {
            Person person = new Person();

            person.name = "Елена";
            Console.WriteLine(person.name + " " + person.age + " ");
            Person person1 = new Person();

            person1.name = "Elena";
            Console.WriteLine(person1.ToString());
            Console.WriteLine(person1.GetHashCode());
            person1.Move();
            Film film1 = new Film("Бойцовский клуб", 1999, 1.03, 18);

            film1.Show();
            Console.WriteLine(film1.ToString());
            film1.Watch();
            News news1 = new News("Погода", "Иванов И. и Иванов К.", 45, 21);

            news1.Show();
            Console.WriteLine(news1.ToString());
            news1.Watch();
            Filmic filmic1 = new Filmic("Форрест Гамп", 1.30, 10);

            filmic1.Show();
            Console.WriteLine(filmic1.ToString());
            filmic1.Watch();
            Cartoon cartoon1 = new Cartoon("Русалочка", 1.10, 6);

            cartoon1.Show();
            Console.WriteLine(cartoon1.ToString());
            cartoon1.Watch();
            Advertisment advertisment1 = new Advertisment(6);

            advertisment1.Show();
            Advertisment advertisment2 = new Advertisment(8);

            Console.WriteLine(advertisment1.ToString());
            advertisment1.Watch();
            Director director1 = new Director("Berton", "Tim", 45);

            director1.Information();
            if (director1 is Director)
            {
                Console.WriteLine("Это известный режиссер");
            }
            if (film1 is News)
            {
                Console.WriteLine("Бред");
            }
            else
            {
                Console.WriteLine("Фильм не является новостями");
            }
            Console.WriteLine();
            foreach (var p in Controller.obj.GetNames(typeof(Controller.obj)))
            {
                Console.WriteLine(p);
            }
            Console.WriteLine((Controller.obj) 1);
            Console.WriteLine();
            User man = new User("Alexei", 19);

            Console.WriteLine(man.Name + " " + man.Age);
            Programms prog1 = new Programms();

            prog1.name_of_prog = "Игра на выживание";
            prog1.Year         = 1999;
            prog1.begin        = 18.00;
            prog1.end          = 18.30;
            prog1.Inf();
            Controller.Time(prog1.begin, prog1.end);
            Programms prog2 = new Programms();

            prog2.begin = 11.30;
            prog2.end   = 12.30;
            Controller.Time(prog2.begin, prog2.end);
            prog2.Year         = 1999;
            prog2.name_of_prog = "Матрица";
            Programms prog3 = new Programms();

            prog3.Year  = 1998;
            prog3.begin = 10.30;
            prog3.end   = 12.00;
            Controller.Time(prog3.begin, prog3.end);
            Programms progi = new Programms();

            List <Programms> TV = new List <Programms>()
            {
                prog1, prog2, prog3
            };

            TV.Add(progi);
            Controller.Count();
            Controller.Search(TV);
        }