|
-
August 31st, 2009, 06:24 PM
#1
Type Conversion Help
Okay, I want to know if you can do something like this, I have a parser and I'm trying to have less and less switch blocks and/or repetitive code.
So something like this. It errors out but can I do something similar?
Code:
object i = 5;
int j = 6;
(i.GetType())i += j;
-
August 31st, 2009, 06:43 PM
#2
Re: Type Conversion Help
Short answer is no. You cannot dynamically cast an object from a System.Type object. Now maybe if you can show us a sample of your switch blocks and/or repetitive code we can try to find another solution.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|