reflection: get default values from struct in assembly
hello there,
im trying to access System.Drawing.Color using reflection to get every RGB value of the colors within it, so i can use those values in other projects without having to copy them by hand.
what i wanted to do was creating a c++ header with something like:
Code:
namespace Colors
{
enum Colors_
{
Red = RGB( 255, 0, 0 ),
Blue = RGB( 0, 0, 255 ),
...
};
}
now within that enum i would like to have every color that is on the Color class in System.Drawing assembly.
ive tried using C# something like:
Code:
public static void Main()
{
StreamWriter out = new StreamWriter( "Colors.h" );
MemberInfo [] members = typeof(System.Drawing.Color).GetMembers();
foreach( MemberInfo in members )
{
out.WriteLine( m.Name + " = RGB( " //and now i dont know how to get the R G and B value of the color being read
so if anyone has ideias, please share them
thanks :D