Here's an explanation of the rule that that I am trying to understand. Here's the simplified code that the Code Analyzer was complaining about:
Public Class CustomerSpeed
Public Enum ProfitTypeEnum As Integer
NotSpecified = 0
FlatAmount = 1
PercentOfProfit = 2
End Enum
Private _ProfitTypeEnum As ProfitTypeEnum
Public Sub New(ByVal profitType As ProfitTypeEnum)
_ProfitTypeEnum = profitType
End Sub
End Class
If the enum pertains only to the class, why is it a bad thing to make it a contained type within the class? Seems neater to me...
Does anyone know what is meant by the following line?:
Nested types include the notion of member accessibility, which some programmers do not understand clearly
Using Namespaces to group the Class and Enum doesn't seem like a useful way to resolve this warning, since I would like both the enum to belong to the same parent level as the class name.