locked
Boolean ENUM Attribute RRS feed

  • Question

  • User-1912941216 posted

    Hello Forum, 

    I am trying to make ENUM attribute that can just be a Boolean. I am sure it is something simple, but I just get the error 'Object variable or With block variable not set.' So I have two questions. i am sure this is probably straight forward, but after 90 mins, I think I might need a bit of help :-(

    1) How can I make the code work below, so I can retrieve the false flag in the attribute is applied
    2) How can I make the check return FALSE is the ServiceDisabled attribute is not applied to the ENUM at all.

    Public NotInheritable Class ServiceDisabled
        Inherits Attribute
    
        Public ReadOnly Property Value() As String
            Get
                Return True
            End Get
        End Property
    
    End Class
            <ServiceDisabled>
            Privacy = 58
    Dim Disabled = MyEnumHelper.GetAttribute(Of ServiceDisabled)({enum-goes-here}).Value

    Many thinks for the assistance in advanced

    Regards
    Graham 

    Thursday, July 25, 2019 1:53 PM

All replies