tags:

views:

68

answers:

7

I have a control with a bunch of fields that I want a user to be able to configure.

I originally had this:

    public bool Phone1Visible;
    public bool Phone1Required;

Then realized that I didn't want to deal with having to validate again hidden required fields, so I came up with this:

public enum YOUR_NAME_HERE
{
    Hidden,
    Optional,
    Required
}

What would you name this enum? I was thinking "FieldCriticality", but that sounds a little wordy.

Suggestions welcome.

+5  A: 

I would use FieldState.

tvanfosson
A: 

I would go by FieldType

public enum FieldType
{
    Hidden,
    Optional,
    Required
}
AlbertEin
A: 

I would use FieldValidation, as a descriptive title of how you wish to use this enum.

Oded
A: 

I would use FieldProperty or FieldAttribute

Andy
A: 

Maybe FieldModifier or FieldInteraction would suit you?

Scott Anderson
A: 

Status

As simple as it gets.

Then you'd get

public Status Phone1Visible;
public Status Phone1Required;

which seems very readable and explanatory, expeciaally when popping up with Intellisense

Kamal
"Status" seems not quite descriptive enough. Maybe "FieldStatus"?
Josh Kodroff
Agreed. From my experience though, Field doesn't really make it much more descriptive. If you have additional types of statuses, I completely agree that FieldStatus is much more useful. But if you don't, I still feel that simpler is better. And with your variables, it's very readable. What's the Status of Phone1Visible vs What's the FieldStatus of Phone1Visible.
Kamal
+2  A: 

How about FieldMode? I think “mode” helps convey that this isn't to do with the value of the field, or how the user is currently interacting with it.

Kevin Reid