Welcome to MSDN Blogs Sign in | Join | Help

August 2005 - Posts

Yes, reflection can get this done. Assume we have an Enum type - Colors, the following code will print the name and value for each member of it. foreach ( FieldInfo fi in typeof ( Colors ).GetFields( BindingFlags .Public | BindingFlags .Static)) { Console Read More...
You might have already read this : VS2005 made the last-minute DCR related to boxed Nullable<T>. Runtime now treats Nullable<T> differently from other generic value types when boxing: Int32 ? x = null ; object y = x; // y is simply null, not Read More...
Type.GetType gives us the ability to get type back from a string. We pass a well-written type name string to it, and expect it return that type. Sometimes, to your surprise, it returns null. For example, Type.GetType("System.Data.SqlClient.SqlException"). Read More...
 
Page view tracker