Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
how do I create a struct similar to system.drawing.color
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Mike Read
14y
1.7k
1
Reply
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?
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
inheriting from usercontrol
shadow copying and updaters