Skip to content

Instantly share code, notes, and snippets.

@CodingGorilla
Created January 11, 2011 14:48
Show Gist options
  • Save CodingGorilla/774498 to your computer and use it in GitHub Desktop.
Save CodingGorilla/774498 to your computer and use it in GitHub Desktop.
Demonstrates the singleton pattern
public class MySingleton
{
public static readonly MySingleton Instance = new MySingleton();
/* Private or protected constructor so only this class can instantiate itself */
private MySingleton()
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment