Example #1
0
        public void PrintGenericFieldType()
        {
            TypeDefinition publicClassWithManyFields = TestConstants.GetGenericClass(TestConstants.BaseLibV1Assembly);

            foreach (FieldDefinition f in publicClassWithManyFields.Fields)
            {
                Console.WriteLine("Field Cecil Type: {0}", f.FieldType.GetType());
            }

            var field = publicClassWithManyFields.Fields.GetField("m_Field");

            Console.WriteLine("Generic Type {0} with field m_Field: {1}", publicClassWithManyFields.Print(), field.Print(FieldPrintOptions.All));

            field = publicClassWithManyFields.Fields.GetField("m_partialGenericField");
            Console.WriteLine("Generic Type {0} with field m_Field: {1}", publicClassWithManyFields.Print(), field.Print(FieldPrintOptions.All));
        }