R
Ray Cassick \(Home\)
I am looking for a generic way to see if an object supports the ToString
method, then invoke that method to return the results of that generic
objects ToString method.
I have a generic exception class and one of the arguments I pass in is a
generic object type.
In this exception class I would like to be able to provide a ToString method
where this value is shown, but the exception class cannot know anything
about the object that is getting passed in. I want to keep it as generic as
possible that way.
I have been poking around with InvokeMember and just can't seem to get it
right.
Can anyone point me in the right direction?
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-7537
Blog: http://spaces.msn.com/members/rcassick/
method, then invoke that method to return the results of that generic
objects ToString method.
I have a generic exception class and one of the arguments I pass in is a
generic object type.
In this exception class I would like to be able to provide a ToString method
where this value is shown, but the exception class cannot know anything
about the object that is getting passed in. I want to keep it as generic as
possible that way.
I have been poking around with InvokeMember and just can't seem to get it
right.
Can anyone point me in the right direction?
--
Raymond R Cassick
CEO / CSA
Enterprocity Inc.
www.enterprocity.com
3380 Sheridan Drive, #143
Amherst, NY 14227
V: 716-316-7537
Blog: http://spaces.msn.com/members/rcassick/