How can I declare an enum that has strings for values?
private enum breakout {
page = "String1",
column = "String2",
pagenames = "String3",
row = "String4"
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As others have said, no you cannot.
You can do static classes like so:
Or
Using readonly, you can actually assign the value in a static constructor. When using const, it must be a fixed string.
Or assign a DescriptionAttribute to enum values, like here.