Description: Variant of singelton: (global variable)
-----------------------------
public class GoForData
{
static GoForData _instance=null
static readonly object _lock = new object()
static Settings _MySetting
// Constructor is protected
GoForData()
{
_MySetting = new Settings() //start setting
}
public static GoForData Instance
{
get{
lock (_lock){
if (_instance == null)
{
_instance = new GoForData()
}
}
return _instance
}
}
public Settings MySetting
{
get{return _MySetting }
set{_MySetting = value }
}
}
To Search:
File list (Check if you may need any files):
Singelton.cs