Hi Experts,
I need to implement data types whose ranges of values are dependent of another variable's value. An example would be
public enum BaseColor{ invalid, red, yellow, green, cyan, blue, magenta};
public enum ColorSelection{ all, rgb, cmy};
private BaseColor someColor = BaseColor.red;
private ColorSelection colorSelection = ColorSelection.all;
In case colorSelection would be set to ColorSelection.rgb, someColor should only be allowed to have values red, green and blue.
In case colorSelection would be set to ColorSelection.cmy, someColor should only be allowed to have values cyan, magenta and yellow.
For a given set of values, types and dependencies, I could write code into the application. But I am supposed to invent something that is open to later change. Something like an ini-file representing dependencies, but at this moment i don't have a clue where to start.
Is there any well-known solution to a similar problem?
Thank you for your patience,
luker