2010-11-17 10 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

Droite - donc c'est du code; quelle est la question? –

Répondre

2

Si vous voulez dire « comment puis-je obtenir les valeurs enum disponibles à partir d'un Type? », Puis (en utilisant la syntaxe C# uniquement pour l'exemple, l'approche devrait fonctionner VB):

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