1
Answer

how do I create a struct similar to system.drawing.color

Ask a question
Mike Read

Mike Read

14y
1.7k
1
I want a struct in my code that is similar in functionality to System.Drawing.Color.

basically, I want a "user friendly" way to access properties (or really for someone to understand my code)

instead of :
something = 0;
switch (something) {
case 0: ....
case 1: ....
}

I want:
something = something.FriendlyValueName;
switch (something) {
case something.FriendlyValueName: ...
case something.DifferentFriendlyValueName: ...
}

for example, with Color...

System.Drawing.Color ABC = new System.Drawing.Color.White;
switch (ABC) {
case System.Drawing.Color.Black: ...
case System.Drawing.Color.White: ...
}

does that make any sense?

Answers (1)