Copy: Hashtable to Properties
- From: "James Scott" <jscott_deltorg@xxxxxxxxxxxxxx>
- Date: Tue, 21 Jun 2005 14:09:07 GMT
Hello,
I have a values stored in a Hashtable hash and I want assign them as
properties to an object obj
obj.x1 = (String)hash[x1];
obj.x2 = (long)hash[x2];
obj.x3 = (int)[x3];
.....
Is there a better (more reusable) way, like this Pseudocode:
foreach (DictionaryEntry de in hash) {
obj.(de.key) = (de.Value.GetType())hash[de.Value];
}
Thanks!
.
- Follow-Ups:
- Re: Copy: Hashtable to Properties
- From: Andy
- Re: Copy: Hashtable to Properties
- Prev by Date: Re: Adv C#?
- Next by Date: Re: Newbie on Inheritance, Base classes and derived classes
- Previous by thread: Re: The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available
- Next by thread: Re: Copy: Hashtable to Properties
- Index(es):