I wish to take user specification of a GeographicColors attribute and then convert that string value to one of the valid GeographicColors color. In other words, I want to take the string "Lake" and convert it to a GeoColor of GeoColor.GeographicColors.Lake.
I'm looking for something more sophisticated that simply defining an array of the current valid values. I would like to actually use the GeographicColors class to do the validation for me. Or to use standard C# code to access the list of attributes that this class has.
I want to do the same thing for StandardColors and SimpleColors.
I've been attempting to do this with C# code, but have been unsuccessful.
Below is a snippet of code of one methode that I have attempted, but comes up with no attributes.
Any assistance would be appreciated.
Regards,
Dennis
Type tGeoColors = typeof(ThinkGeo.MapSuite.Core.GeographicColors);
FieldInfo[] fieldInfos = tGeoColors.GetFields();
if (fieldInfos != null)
{
foreach (FieldInfo fieldInfo in fieldInfos)
{
object value = fieldInfo.ToString();
}
}