How to list static properties (shared property) equal to System.Drawing.Color

0

I have a structure called Servicos and in it I have some static properties.

Public Structure Servico

        Public Shared ReadOnly Property Instalacao As Servico
            Get
                Return New Servico(ServicesType.Instalacao)
            End Get
        End Property

        Public Shared ReadOnly Property Desativacao As Servico
            Get
                Return New Servico(ServicesType.Desativacao)
            End Get
        End Property

        Public Shared ReadOnly Property TrocaVeiculo As Servico
            Get
                Return New Servico(ServicesType.TrocaVeiculo)
            End Get
        End Property

        Public Shared ReadOnly Property TrocaTitularidade As Servico
            Get
                Return New Servico(ServicesType.TrocaTitularidade)
            End Get
        End Property

End Structure

I'd like you to make some kind of statement like this:

Dim objServico as Servico

List all my services the same when declaring a color. An image for better understanding:

    
asked by anonymous 12.04.2016 / 21:41

1 answer

1

Access members of a class or structure (which gives the same effect with members of the public instance) and is quite different from accessing static (shared) members of a type. Static members can only be accessed through the type and not the instance. That's why IDE does not even show them. Then you can not access:

objServico.Instalacao

It should be:

Service.Instalacao

    
12.04.2016 / 21:54