code_junkie

Limit Values for Properties in .NET

Nov 14th, 2011
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <uc:somecontrol runat="server" id="uc1" property1="red" />
  2.  
  3. Enum ControlColor
  4. Red = 1
  5. Blue = 2
  6. Green = 3
  7. End Enum
  8.  
  9. Public Property MyProperty As ControlColor
  10.  
  11. Public Enum ControlColor
  12. Red = 1
  13. Blue = 2
  14. Green = 3
  15. End Enum
  16.  
  17. Private _color As ControlColor
  18.  
  19. Public Property [Color] As ControlColor
  20. Get
  21. Return _color
  22. End Get
  23. Set (ByVal value As ControlColor)
  24. _color = value
  25. End Set
  26. End Property
Add Comment
Please, Sign In to add comment