I\'ve been studying the Singleton pattern as it is used in the Settings class. Here\'s the relevant code from Settings.Designer.cs for my project AccessTest:
int
Normaly, your Default property is called Instance
So that you can call your singleton like this :
Settings.Instance. X FUNCTION()
Design Pattern by Erich Gamma is pretty solid on design pattern. You should be able to find a PDF on the web easily :)
BTW you should also add this to your Default/Instance property
If(defaultInstance == null)
{
defaultInstance = new Settings();
}
return defaultInstance
That way your singleton is never null and is lazy instantiated