Public Class ColorObserver
Public Shared Event ColorUpdated()
Private Shared _SelectedColor As Colors
Public Enum Colors
Red = 0
White = 1
Blue = 2
#Region "Singleton Design Patern"
REM Use a Singleton Design patern to ensure that this class can only be instanciated once
Public Shared s As ColorObserver
Public Shared flag As Boolean
Private Sub New()
'private constructor disallowing other to create object directly
Public Shared Function getSingletonObject() As ColorObserver
If flag = False Then
'return a new object
s = New ColorObserver
flag = True
'future object request
'return an already created object
#Region "Color Functions"
Public Property Color() As Colors
Set(ByVal Color As Colors)
_SelectedColor = Color
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here