Sign In
Haibo Luo's weblog
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
RSS for posts
Atom
RSS for comments
OK
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
DynamicMethod
IronPython
IronRuby
Miscellaneous
Pages
Reflection
Reflection.Emit
VisualStudio
Archive
Archives
April 2010
(1)
March 2008
(5)
October 2007
(6)
September 2007
(3)
August 2007
(1)
November 2006
(7)
October 2006
(2)
August 2006
(1)
July 2006
(1)
April 2006
(1)
February 2006
(2)
January 2006
(2)
November 2005
(2)
October 2005
(2)
September 2005
(2)
August 2005
(3)
August, 2005
MSDN Blogs
>
Haibo Luo's weblog
>
August, 2005
Posts
Subscribe via RSS
Sort by:
Most Recent
|
Most Views
|
Most Comments
Excerpt View
|
Full Post View
Haibo Luo's weblog
Get Names and Values of Enum Members
Posted
over 7 years ago
by
Haibo Luo - MSFT
2
Comments
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...
Haibo Luo's weblog
Reflection and Nullable<T>
Posted
over 7 years ago
by
Haibo Luo - MSFT
4
Comments
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; ...
Haibo Luo's weblog
Type.GetType(string typeName) returns null !?
Posted
over 7 years ago
by
Haibo Luo - MSFT
7
Comments
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...
Page 1 of 1 (3 items)