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



在类中有一个枚举:

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

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

你是怎么做到的?

Enum语句和常量:

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"
    .....
.....

相关内容

  • 没有找到相关文章

最新更新