Exemple #1
0
        private System.Reflection.FieldInfo GetField(int fieldIndex, object o)
        {
            System.Type clazz = o.GetType();
            string      key   = clazz.FullName + fieldNames[fieldIndex];

            System.Reflection.FieldInfo field = (System.Reflection.FieldInfo)map[key];
            if (field != null)
            {
                return(field);
            }
            System.Collections.IList l = classIntrospector.GetAllFields(clazz.FullName);
            for (int i = 0; i < l.Count; i++)
            {
                field = (System.Reflection.FieldInfo)l[i];
                if (field.Name.Equals(fieldNames[fieldIndex]))
                {
                    map.Add(key, field);
                    return(field);
                }
            }
            throw new System.Exception("Field " + fieldNames[fieldIndex] + " does not exist on class "
                                       + o.GetType());
        }