> I want to create my own ToString() function, which outputs a summary
> of a class.
[quoted text clipped - 22 lines]
>
> Thanks in advance!!!
Well, at that point you're really writing out information about the
*type* rather than about the object itself (unless you include the
values of the properties etc).
There are various methods on Type which return the fields, methods,
properties etc. You'll need to think about whether you want to show
inherited members as well.
Jon
Marco Balk - 27 Feb 2008 14:35 GMT
> > I want to create my own ToString() function, which outputs a summary
> > of a class.
[quoted text clipped - 32 lines]
>
> Jon
Thanks Jon.
This is just what I need.
I guess there's no way to display private or protected Members?
Jon Skeet [C# MVP] - 27 Feb 2008 14:55 GMT
<snip>
> This is just what I need.
> I guess there's no way to display private or protected Members?
Yes, you just need to specify BindingFlags.NonPublic.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk