Return to Snippet

Revision: 8278
at September 11, 2008 10:07 by DaveChild


Initial Code
Public Class ClassName

    Private Shared objClassName As ClassName
    Private Shared blnClassAlreadyCreated As Boolean = False

    Private Sub New()
    End Sub

    Public Shared Function setupClass() As ClassName
        If blnClassAlreadyCreated = False Then
            objClassName = New ClassName()
            blnClassAlreadyCreated = True
        End If
        Return objClassName
    End Function

End Class

Initial URL
http://www.ondotnet.com/pub/a/dotnet/2002/11/11/singleton.html

Initial Description

                                

Initial Title
VB.NET Singleton Class

Initial Tags
class

Initial Language
VB.NET