I tried to create an abstract control to control some state in our application. However, I ran into some CLS issues and was hoping that someone could give some insight.
I have an enumeration as such:
<Flags()> _
Public Enum FormState
Read = 1
Edit = 2
Insert = 4
End Enum
And the class itself:
Public MustInherit Class Fields
Inherits System.Web.UI.UserControl
Public Property State() As Enumerators.FormState
Get
Return _State
End Get
Set(ByVal value As Enumerators.FormState)
_State = value
ToggleState(value)
End Set
End Property
Protected MustOverride Sub ToggleState(ByVal state As FormState)
End Class
When I try to compile this code, I leave a warning that the State property is not CLS-compatible and is not a state argument. How so? And how can I fix this problem to remove warnings?
- I tried adding the <CLSCompliant (True)> attribute to both elements with no luck
- MSDN "MustOverride" , CLS, CLS-
Friend Public- Enum (
Integer UInteger)