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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • samueltilden@gmail.com

    #1

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

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

    I can easily GetType() and GetType().GetPr operties().

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

    The problem is arrays or collections which require this syntax:

    PropertyInfo.Ge tValue(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.Ge tValue(Object, Object[] index)

    Any ideas? clues?

    Thanks.

  • Marc Gravell

    #2
    Re: PropertyInfo.Ge tValue(object Obj, object[] index)

    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

    Comment

    Working...