471,616 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,616 software developers and data experts.

PropertyInfo.GetValue(object Obj, object[] index)

I am writing a very generic DumpObject(object Obj) method.

I can easily GetType() and GetType().GetProperties().

I can easily PropertyInfo.GetValue(Obj, null) for scalar variables.

The problem is arrays or collections which require this syntax:

PropertyInfo.GetValue(Object, Object[] index)

What do I enter for the array of objects, called "index" in the
documentation?

No matter what I have tried so far, I always get an "argument out of
range exception" when I try to execute:

PropertyInfo.GetValue(Object, Object[] index)

Any ideas? clues?

Thanks.

Jun 27 '08 #1
1 3442
Any ideas? clues?

Answered with an example on the previous post. In this case, it isn't
the *property* that is indexed, but the value returned *from* the
property.

Marc
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by tatilou | last post: by
5 posts views Thread by Przemek M. Zawada | last post: by
1 post views Thread by =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post: by
7 posts views Thread by colin | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.