27 lines
550 B
C#
27 lines
550 B
C#
namespace FileWatcher
|
|
{
|
|
//http://csharpindepth.com/articles/general/singleton.aspx
|
|
public sealed class Singleton
|
|
{
|
|
private static readonly Singleton instance = new Singleton();
|
|
|
|
// Explicit static constructor to tell C# compiler
|
|
// not to mark type as beforefieldinit
|
|
static Singleton()
|
|
{
|
|
}
|
|
|
|
private Singleton()
|
|
{
|
|
}
|
|
|
|
public static Singleton Instance
|
|
{
|
|
get
|
|
{
|
|
return instance;
|
|
}
|
|
}
|
|
}
|
|
}
|