M
M O J O
Hi,
I want to expose a enum from another class, is that possible and how?
Here's an example
Public Class ClassMaster
Public Enum Colors
Red
Green
Yellow
End Enum
End Class
Public Class Cars
Public ReadOnly Property Colors() As System.Enum
Get
Return ClassMaster.Colors ' <- Error
End Get
End Property
End Class
Module Main
Public Sub Main()
Private color As Cars.Colors ' <- Error
End Sub
End Module
I know I can make the Enum global by putting it in a module, but I want
to expose it from another class.
I'm creating an application using three layer style, that is
"Presentation layer", "Business layer" and "Data layer".
I do not want the "Presentation layer" to reference the "Data layer".
They must know nothing about each others.
All communication to the "Data layer" must go through the "Business layer".
I have an enum in the "Data layer" which I want the "Presentation layer"
to use, but it must go through the "Business layer".
Hope you get what I mean.
Any idea?
Thanks!
M O J O
I want to expose a enum from another class, is that possible and how?
Here's an example
Public Class ClassMaster
Public Enum Colors
Red
Green
Yellow
End Enum
End Class
Public Class Cars
Public ReadOnly Property Colors() As System.Enum
Get
Return ClassMaster.Colors ' <- Error
End Get
End Property
End Class
Module Main
Public Sub Main()
Private color As Cars.Colors ' <- Error
End Sub
End Module
I know I can make the Enum global by putting it in a module, but I want
to expose it from another class.
I'm creating an application using three layer style, that is
"Presentation layer", "Business layer" and "Data layer".
I do not want the "Presentation layer" to reference the "Data layer".
They must know nothing about each others.
All communication to the "Data layer" must go through the "Business layer".
I have an enum in the "Data layer" which I want the "Presentation layer"
to use, but it must go through the "Business layer".
Hope you get what I mean.
Any idea?
Thanks!
M O J O