mirror of
https://github.com/soarqin/DSP_Mods_TO.git
synced 2025-12-12 01:23:31 +08:00
21 lines
342 B
C#
21 lines
342 B
C#
|
|
|
|
namespace XianTu;
|
|
|
|
public class Singleton<T> where T : new()
|
|
{
|
|
public static T Instance
|
|
{
|
|
get
|
|
{
|
|
var flag = _msInstance == null;
|
|
if (flag)
|
|
{
|
|
_msInstance = new T();
|
|
}
|
|
return _msInstance;
|
|
}
|
|
}
|
|
|
|
private static T _msInstance;
|
|
} |