is there a way to make an enum value not browsable to combo box
or just, not to come back from Enum.GetValues() ??
public enum DomainTypes
{
[Browsable(true)]
Client = 1,
[Browsable(false)]
SecretClient = 2,
}
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.
There is nothing already in place to do this for you with the
Enum.GetValues()method. If you want to use attributes, you can create your own custom attribute and use it via reflection:And then you can use reflection to check for custom attributes and generate a list of Enums based on the
Browsableattribute.