Re: getting values from object with reflection ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Jon Skeet [C# MVP] (skeet_at_pobox.com)
Date: 10/20/04


Date: Wed, 20 Oct 2004 01:50:17 +0100

andrewcw <andrewcw@acw.com> wrote:
> I have a snippet of code that feeds a tree view, the properties show up BUT
> if I try and obtain the values of the property the code throws an error.
>
> // throws an excpetion
> //property_value = p.GetValue(this,null); //
> // the VN .NET code for a similar project has
> // property_value = .GetValue(Me, Nothing)
> // i
>
> Of course the object would not have values unless this object is
> instantiated. So maybe that is a problem too. Please advise here's the
> trouble:

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

-- 
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Relevant Pages

  • Re: Definition of the word Tsiyon ...
    ... take a moment to think about that "Tree of Knowledge." ... Decaying stuff, the discards, the offal...the bullshit. ... even someone the likes of you feeds off that bullshit. ...
    (sci.lang)
  • Re: Definition of the word Tsiyon ...
    ... take a moment to think about that "Tree of Knowledge." ... Decaying stuff, the discards, the offal...the bullshit. ... even someone the likes of you feeds off that bullshit. ...
    (sci.lang)
  • Re: Help with apple tree
    ... There is a lot going on in that border and it is possible that the particular apple tree is coming out worst in the battle for food in general. ... The borders have been hacked back in a pretty big way now, but I guess there's still competition for food, what are the best feeds? ... I suspect from what the neighbours have said that a previous owner paid someone to plant the garden up but whether that included the apple trees I have no idea. ... My standard feed for almost anything (without special feeding requirements) is a mixture of Growmore, chicken sh*t, and manure. ...
    (uk.rec.gardening)
  • Re: Allocating Four Dimensional Dynamic Arrays...
    ... I tailored that snippet of code to suit my needs a little ... That above snippet should allocate a tree of matrices "v" which have a ... The tree will be n rows and each proceding row will have n ... with my current method of allocating matrice. ...
    (comp.lang.cpp)
  • Re: Allocating Four Dimensional Dynamic Arrays...
    ... I tailored that snippet of code to suit my needs a little ... That above snippet should allocate a tree of matrices "v" which have a ... The tree will be n rows and each proceding row will have n ... with my current method of allocating matrice. ...
    (comp.lang.cpp)