Posted By

ad5qa on 01/15/08


Tagged


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

mtelligent
umang_nine
vali29
rodrigojuarez


Enum Property


 / Published in: C#
 

Usefull class property using enum type instead of int's. For example: if (ActionType == CurrActionType.create){} plain english is easier to read than if (ActionType == 0){} What was 0 again?

  1. public enum CurrActionType
  2. {
  3. view, edit, create
  4. }
  5. private CurrActionType currActionType;
  6.  
  7. public CurrActionType ActionType
  8. {
  9. get
  10. {
  11. return currActionType;
  12. }
  13. set
  14. {
  15. currActionType = value;
  16. }
  17. }

Report this snippet  

You need to login to post a comment.