List of functions in a class

  • Thread starter Thread starter Marco Balk
  • Start date Start date
M

Marco Balk

I want to create my own ToString() function, which outputs a summary
of a class.
How can I retrieve a list of functions in a class?

I want to try to get the following output (this will be a nice HTML
list):

Class foo
- functions:
--- static function static_foo()
--- public function public_foo()
--- private function private_foo()
- variables
--- public int X
--- public string Y
--- protected bool Z
- properties
--- public string Name
--- public int Age


Code example:

foo objFoo = new foo();
Response.Write(objFoo.ToString());


Thanks in advance!!!
 
I want to create my own ToString() function, which outputs a summary
of a class.
How can I retrieve a list of functions in a class?

I want to try to get the following output (this will be a nice HTML
list):

Class foo
- functions:
--- static function static_foo()
--- public function public_foo()
--- private function private_foo()
- variables
--- public int X
--- public string Y
--- protected bool Z
- properties
--- public string Name
--- public int Age

Code example:

foo objFoo = new foo();
Response.Write(objFoo.ToString());

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
 
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

Thanks Jon.

This is just what I need.
I guess there's no way to display private or protected Members?
 
Back
Top