vb.net - What is the point of CTypeDynamic? -
i'm using reflection serialize object. getting values objects real murder on performance due late binding penalties. ctype / directcast can rid of of can't feed type variable i'm using switch case block on type variable select correct directcast.
it came attention ctypedynamic exists , takes type variables return type object so... converts object object, cool. got me wondering, purpose of function?
the ctypedynamic function looks dynamic information , performs cast/conversion appropriately. different ctype operator looks static information @ compile time or relies on types being iconvertible.
this function examines object @ runtime including looking shared (aka static) custom operators. always, if know type use ctype, if need dynamic casting need use ctypedynamic.
more information here: http://blogs.msmvps.com/bill/2010/01/24/ctypedynamic/
Comments
Post a Comment