|
Re: Reflection Casting
I haven't really used reflection, but I'm fairly certain that the information is retrieved at run time from the assembly metadata; thus there is no way to do compile-time casting. You can check to see if object X is an instance of class Y (including a class derived from class Y), or if it implements interface Z. In most cases, this should be all you need.
What is it you're trying to do, exactly? Why do you want to determine the cast type at run time?
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
|