CodePlexProject Hosting for Open Source Software
Would it be possible to make whether or not the enum generated from a Type Table is a set of flags (i.e., have the enum decorated with the Flag attribute)? I find I use enums as flags about half the time.
This not something that we will do soon. This requires a model change and some validation rules associated with it. It is something we might explore but right now we are full trying to get more templates out and rework the existing ones. What would
adding an attribute to the enum buy you? What would you do with it? Please explain how you want to use it.
Right now the enum that gets generated cannot be used as a set of flags:
public enum AccessRights
Add = 1,
Edit = 2,
Delete = 4
if( (user.AccessRights & AccessRights.Delete) ) ... allow deletion
I know how to use the bit flags; I was just wondering why you need an attribute on th enum to tell you that it is an bit flag. Since you are the one who built the model, you know that it is a bit flag. You can build code just like that now. I am confused
what adding another attribute to the enumeration would matter.
Are you sure you want to delete this post? You will not be able to recover it later.
Are you sure you want to delete this thread? You will not be able to recover it later.