What determines which name is selected when calling ToString() on an enum value which has multiple corresponding names?
问题 What determines which name is selected when calling ToString() on an enum value which has multiple corresponding names? Long explanation of question follows below. I have determined that this not determined uniquely by any of: alphabetical order; declaration order; nor, name length. For example, consider that I want to have an enum where the numeric values correspond directly to a practical use, (e.g. rgb values for color). public enum RgbColor { Black = 0x000000, Red = 0xff0000, Green =