Re: Dynamically determine and cast type
Chris Tavares <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.clr |
|---|---|
| Message-ID | <001b01c8287b$9b7d7cc0$d2787640$@com> |
Have you looked at the TypeConverter infrastructure? In general, you need support from the type you're converting into; TypeConverters are that support. -Chris -----Original Message----- From: Discussion of development on the .NET platform using any managed language [mailto:[email protected]] On Behalf Of Brady Kelly Sent: Friday, November 16, 2007 2:13 AM To: [email protected] Subject: [DOTNET-CLR] Dynamically determine and cast type I want to write a method that takes a Property object and a string as parameters, and based on the type of the property, converts the string to the correct type, with a null for empty strings, and assigns in to the property. I don't like the idea of using a switch, so how could I go about this? =================================== This list is hosted by DevelopMentor. http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com