Esempio n. 1
0
        public static void TestClainIProps()
        {
            Console.WriteLine("Объект класса ClainP вызывает открытые методы!");
            ClainP clain = new ClainP();

            clain.MyProp1("Свойство 1 объекта");
            clain.MyProp2("Владимир", 44);
            Console.WriteLine("Объект класса IProps вызывает открытые методы!");
            IProps ip = clain;

            ip.Prop1("интерфейс: свойство");
            ip.Prop2("интерфейс: свойство", 77);
            Console.WriteLine();
        }
Esempio n. 2
0
        static void Main()
        {
            Employee e = new Employee("Joe", 80, 30000);

            e.GiveBonus(200);
            var e2 = new Employee("Beth", 81, 50000);

            e2.GiveBonus(1000);
            e2.DisplayStats();
            Console.WriteLine();

            Person.TestPersonProps();
            Person.TestPersonChildren();

            Found.TestFoundProps();
            Derived.TestDerivedProps();

            ClainP.TestClainIProps();
            ClainTwo.TestTwoInterfaces();

            Console.ReadKey();
        }