Click here to Skip to main content
15,886,067 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",...
No downloads associated with this content

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.

License

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



Comments and Discussions