Public Class ScoringStrategyEntity
Public Enum TotalingMethodType
Weighted_Share
Multiply_Components
End Enum
Private _TotalingMethod As TotalingMethodType
Public Property TotalingMethod() As TotalingMethodType
Get
Return _TotalingMethod
End Get
Set(ByVal value As TotalingMethodType)
_TotalingMethod = value
End Set
End Property
End Class
Dim ScoringStrategy As Object = Activator.CreateInstance("MyDll", "MyDll.ScoringStrategyEntity").Unwrap()
For Each Enum In ScoringStrategy.TotalingMethodType
Next
答案 0 :(得分:2)
如果您的意思是“如何从Type
获取可用的枚举值?”,那么(仅使用C#语法作为示例; 方法应该在VB中工作):
var values = Enum.GetValues(typeof(ScoringStrategy.TotalingMethodType));