mirror of
https://github.com/StarBeat/JsonRpc.git
synced 2026-03-08 12:05:29 +08:00
20 lines
344 B
C#
20 lines
344 B
C#
|
|
public abstract class AbsSingle<T> where T : class, new()
|
||
|
|
{
|
||
|
|
static public T Instance
|
||
|
|
{
|
||
|
|
get
|
||
|
|
{
|
||
|
|
return SingleHolder.instance;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private static class SingleHolder
|
||
|
|
{
|
||
|
|
public static T instance;
|
||
|
|
static SingleHolder()
|
||
|
|
{
|
||
|
|
instance = new T();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|