2010-11-17 67 views
0
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 
+2

右 - 这是代码;什么是问题? – 2010-11-17 20:03:41

回答

2

如果你的意思是“我怎样才能从Type获得可用枚举值?”,然后(用C#语法纯粹是为了例子; 方法应该工作在VB):

var values = Enum.GetValues(typeof(ScoringStrategy.TotalingMethodType));