1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
public class Singelton
{
private static Singelton me = null;
static readonly object padlock0 = new object(); //Zur Threadsicherheit
private Singelton()
{
//Initialize
}
public static Singelton GetInstance()
{
lock (padlock0)
{
if(me == null)
{
me = new Singelton();
}
return me;
}
}
}
|