Introduction - If you have any usage issues, please Google them yourself
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 }
}
}