Пример #1
0
        private void Main03()
        {
            int x = MyUtility.Read();

            Console.WriteLine("{0} * 2  = {1}", x, Tmp01.ChangeInt(Tmp01.DubInt, x));
            Console.WriteLine("{0} + 1  = {1}", x, Tmp01.ChangeInt(Tmp01.IncInt, x));
            Console.WriteLine("{0} - 1  = {1}", x, Tmp01.ChangeInt(Tmp01.DecInt, x));
        }
Пример #2
0
        private void Main00()
        {
            Tmp01 tM = new Tmp01();

            tM.Print01();          //wywołanie metody nie statycznej wywołane na obiekcie
            tM.Print02();
            new Tmp01().Print01(); //w locie
            new Tmp01().Print02();

            Tmp01.Print03(); // na klasie bo statyczne
            Tmp01.Print04();
        }
Пример #3
0
        delegate void TestDel01(); //funkcja do wywoływania innych funkcji

        private void Main02()
        {
            Tmp01     tM    = new Tmp01();
            TestDel01 myDel = new TestDel01(tM.Print01);// bez nawiasow

            myDel();
            Console.WriteLine("-----------------------------");
            myDel += Tmp01.Print03;
            myDel += tM.Print01;
            myDel += tM.Print02;
            Console.WriteLine("-----------------------------");
            myDel += tM.Print01;
            myDel();
        }