public class Singleton private static readonly Singleton instance new

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
public class Singleton
{
private static readonly Singleton instance = new Singleton();
public string Date { get; private set; }
private Singleton()
{
Date = System.DateTime.Now.TimeOfDay.ToString();
}
public static Singleton GetInstance()
{
return instance;
}
}