C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Singleton Example


Posted Date: 06 May 2008    Resource Type: Code Snippets    Category: VB.NET Syntax

Posted By: komaladevi       Member Level: Gold
Rating:     Points: 10






Public Class Singleton
Private Shared SP As Singleton
Private InnerList as New Collections.ArrayList()

Private Sub New()
End Sub

Public Shared Function Create() As Singleton
If SP is Nothing Then SP = New Singleton()
Return SP
End Function

Public ReadOnly Property List As Collections.ArrayList
Get
Return InnerList
End Get
End Property
End Class

Module SingletonExample
Sub Main
Dim CountValue as Integer
Dim SP As Singleton = Singleton.Create()
Dim SP2 As Singleton = Singleton.Create()

SP.List.Add("First")
SP.List.Add("Second")
SP.List.Add("Third")

For CountValue = 0 To SP2.List.Count - 1
Console.WriteLine(SP2.List.Item(CountValue).ToString())
Next
End Sub
End Module





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Type Safe dictionary
Previous Resource: Compute Hash
Return to Discussion Resource Index
Post New Resource
Category: VB.NET Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

SPOC

Contact Us    Privacy Policy    Terms Of Use