コード例 #1
0
        static void Main()
        {
            DerivedClass instance = new DerivedClass();

            instance.Method();
            instance.Method1();
            instance.Method2();

            Console.WriteLine(new string('-', 40));

            BaseClass instance0 = instance as BaseClass;

            instance0.Method();

            Interface1 instance1 = instance as Interface1;

            instance1.Method1();

            Interface2 instance2 = instance as Interface2;

            instance2.Method2();

            // Delay.
            Console.ReadKey();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: vbre/CS_2015_Winter
        static void Main()
        {
            DerivedClass instance = new DerivedClass();
            instance.Method();

            IInterface instance1 = instance as IInterface;
            instance1.Method();

            // Delay.
            Console.ReadKey();
        }
コード例 #3
0
        static void Main()
        {
            DerivedClass instance = new DerivedClass();

            instance.Method();

            IInterface instance1 = instance as IInterface;

            instance1.Method();

            // Delay.
            Console.ReadKey();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: vbre/CS_2015_Winter
        static void Main()
        {
            DerivedClass instance = new DerivedClass();
            instance.Method();
            instance.Method1();
            instance.Method2();

            Console.WriteLine(new string('-', 40));

            BaseClass instance0 = instance as BaseClass;
            instance0.Method();

            Interface1 instance1 = instance as Interface1;
            instance1.Method1();

            Interface2 instance2 = instance as Interface2;
            instance2.Method2();

            // Delay.
            Console.ReadKey();
        }