Get an objects value as a string
- From: "Ray Cassick \(Home\)" <rcassickNOSPAM@xxxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 01:24:26 -0400
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/
.
- Follow-Ups:
- Re: Get an objects value as a string
- From: Cor Ligthert
- Re: Get an objects value as a string
- From: Ray Cassick \(Home\)
- Re: Get an objects value as a string
- Prev by Date: Limitation to drawing on a form
- Next by Date: Re: WROX Books Beginning VB.NET
- Previous by thread: Limitation to drawing on a form
- Next by thread: Re: Get an objects value as a string
- Index(es):
Relevant Pages
|