Beispiel #1
0
        public static Field ReverseEngineer(System.Reflection.FieldInfo _field)
        {
            Field field = new Field();

            field.Name       = _field.Name;
            field.IsLiteral  = _field.IsLiteral;
            field.IsStatic   = _field.IsStatic;
            field.IsInitOnly = _field.IsInitOnly;
            field.Access     = _field.GetAccessModifier();
            field.ReturnType = ReverseEngineer(_field.FieldType);
            field.Type       = ReverseEngineer(_field.DeclaringType);

            if (field.IsLiteral)
            {
                field.LiteralValue = _field.GetRawConstantValue();
            }

            return(field);
        }