The Only C# .NET Singleton You’ll Ever NeedPosted: September 2, 2008
My colleague, Riaan Hanekom from NGenerics fame, showed me his perfect code for a singleton in C# .NET (version 2 and later). This generic class can create a singleton for any non-static class that has a default constructor.
Copyright 2008 The NGenerics Team
(http://www.codeplex.com/NGenerics/Wiki/View.aspx?title=Team)This program is licensed under the Microsoft Permissive License (Ms-PL). You should
have received a copy of the license along with the source code. If not, an online copy
of the license can be found at http://www.codeplex.com/NGenerics/Project/License.aspx.
*/public static class Singleton<T> where T:new()