文件名称:Singelton
- 所属分类:
- C#编程
- 资源属性:
- [Windows] [Visual.Net] [Basic/ASP] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 1kb
- 下载次数:
- 0次
- 提 供 者:
- Drak****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
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 }
}
}-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 }
}
}
-----------------------------
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 }
}
}-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 }
}
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
Singelton.cs