I've attempted to create an abstracted control to manage some of the state in our application. However, I have run a foul of some CLS issues and was hoping that someone could provide some insight.
I have an enumeration as such:
<Flags()> _
Public Enum FormState
Read = 1
Edit = 2
Insert = 4
End Enum
And a class as such:
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 attempt to compile this code I am left with a warning that the State property is not CLS compliant and neither is the state argument. How come? And how can I correct this problem to remove the warnings?
Friend
instead of Public
Integer
and UInteger
)Looking at your code, the enum seems to be part of a class called enumerators. The class is not listed in your code, but I'm assuming that you have full control over it.
The class needs to be tagged with the CLS compliant attribute as well.