示例#1
0
        public void InitClass()
        {
            Console.WriteLine("--- cData ---");
            CData c1 = new CData()
            {
                cDec = 5
            };
            CData c2 = new CData {
                cDec = 5
            };

            Console.WriteLine("c1: (" + c1.cStr + ", " + c1.cDec + ", " + c1.cFlag + ")");
            Console.WriteLine("c2: (" + c2.cStr + ", " + c2.cDec + ", " + c2.cFlag + ")");

            Console.WriteLine("--- aData ---");
            AData a1 = new AData()
            {
                cDec = 5
            };
            AData a2 = new AData {
                cDec = 5
            };

            Console.WriteLine("a1: (" + a1.cStr + ", " + a1.cDec + ", " + a1.cFlag + ")");
            Console.WriteLine("a2: (" + a2.cStr + ", " + a2.cDec + ", " + a2.cFlag + ")");
        }
示例#2
0
        public void ClassMember()
        {
            CData cd = new CData()
            {
                cStr = "Student", cDec = 50, cFlag = true
            };

            Console.WriteLine("First [" + cd.cStr + "," + cd.cDec + "," + cd.cFlag + "]");

            foreach (System.Reflection.FieldInfo f in typeof(CData).GetFields())
            {
                Console.WriteLine(f.Name + ", ");
            }
        }
示例#3
0
        public void ClassName()
        {
            CData cd = new CData()
            {
                cStr = "Student", cDec = 50, cFlag = true
            };

            Console.WriteLine("First [" + cd.cStr + "," + cd.cDec + "," + cd.cFlag + "]");

            Type cls = typeof(CData);

            Console.WriteLine("  name      [" + cls.Name + "]");
            Console.WriteLine("  namespace [" + cls.Namespace + "]");
            Console.WriteLine("  full      [" + cls.ToString() + "]");
        }