//优点:保证数据全局唯一性
public class TDataManager
{
/// <summary>
/// 数据管理器
/// </summary>
static private TDataManager _manager = null;
private TDataManager()
{ }
/// <summary>
/// 取得数据管理器
/// </summary>
/// <returns>TDataManager</returns>
static public TDataManager getManager()
{
if(_manager == null)
{
_manager = new TDataManager();
}
return _manager;
}
//数据内容举例
priave int _age;
public int Age
{
set{_age=value;}
get{return _age;}
}
......
......
}