枚举,无需实例化即可使用

时间:2013-01-10 14:31:24

标签: asp.net vb.net enums global

我在类中有一个枚举:

Public Class objConjuntosDeAvaliacoes    
    Const conjuntoTipoComparacao As String = "cmp"
    Const conjuntoTipoEvolucao As String = "evp"

    Function removeDoConjunto(ByVal ansSerie As Integer, 
                              ByVal ansAvaliacao As Integer) As Integer

我希望这个枚举在所有代码文件中都可用,而不必实例化该类。

你是怎么做到的?

1 个答案:

答案 0 :(得分:0)

Enum StatementsConstants

Public Class objConjuntosDeAvaliacoes
    .....  
    'enums
    Public Enum YourEnums
        conjuntoTipoComparacao = 1
        conjuntoTipoEvolucao = 2
    End Enum

    'public constants
    Public Const conjuntoTipoComparacao As String = "cmp"
    Public Const conjuntoTipoEvolucao As String = "evp"
    .....
.....