Enum

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have a class property of type enum. The enum name is TemplateType:

Private _Type As TemplateType
< _
Bindable(True), _
DefaultValue(""), _
Public Property Type() As TemplateType
Get
Return _Type
End Get
Set(ByVal value As TemplateType)
_Type = value
End Set
End Property

I need to run some code if a Type was defined. If Type wasn't defined
then I will not run this code.

How can I do this?

Should I add a Enum item named None and make it the default value?

Thanks,

Miguel
 
Enum is basically a value type and it does not have null directly (unless
you play with nullable types). Making an enum with None value is clear and
straighforward approach.
 
Back
Top