Click here to Skip to main content
15,886,362 members
Articles / Programming Languages / C#

Simple Singleton Pattern in C#

Rate me:
Please Sign up or sign in to vote.
3.83/5 (20 votes)
8 Jul 2011CPOL 33.5K   12  
This should do it as well:class Singleton { public static readonly Singleton m_Instance = new Singleton(); // Prevent instance creation from other classes private Singleton() { } public static Singleton Instance { get { return m_Instance; } }}And it is "Singleton",...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions