示例#1
0
        public static void Run()
        {
            Console.WriteLine("-Class");

            ClassNamespace.Class1 obj = new ClassNamespace.Class1();
            Action(obj);
            obj.Method2();
        }
示例#2
0
        public static void Run()
        {
            Console.WriteLine("-function");

            Console.WriteLine("-Function");

            ClassNamespace.Class1 obj = new ClassNamespace.Class1();
            obj.Method1();
            obj.Method2();
        }
示例#3
0
        public static void Run()
        {
            Console.WriteLine("-Is operator");

            ClassNamespace.Class1 d = new ClassNamespace.Class1();
            Console.WriteLine(d is ClassNamespace.BaseClass);
            Console.WriteLine(d is ClassNamespace.Class1);

            int value = 5;

            if (value is int a)           // if value is int set a
            {
                Console.WriteLine(a + 5); // output 30
            }
        }