Hi everybody!
How can I convert types GeoColor & GeoHatchStyle to type String. I need to get the names like "red" or "blue", "DottedDiamand" or "BackwardDiagonal". Thank you.
Hi everybody!
How can I convert types GeoColor & GeoHatchStyle to type String. I need to get the names like "red" or "blue", "DottedDiamand" or "BackwardDiagonal". Thank you.
Exuse me, don't anybody knows are there any opportunitirs to do the work above? Thank you.
Hi Nick,
There are 2 options, one is override the ToString() method. Another is Create a method like GetColorString(GeoColor geoColor) to return a string, you can do what ever you need in that method.
Thanks,
Lee
Nick,
Some of the styling items are enums, like GeoHatchStyle. You can do this to get a string equivalent back:
GeoHatchStyle g = GeoHatchStyle.BackwardDiagonal;
MessageBox.Show(Enum.GetName(typeof(GeoHatchStyle), g));
However, GeoColor is a structure so you’ll have to come up with another way.
Allen
Allen,
Thanks for your help, that’s really precious.
Nick,
You can try the way which Allen and Lee mentioned.
Any more questions please feel free to let me know.
Thanks,
Gary