Simple Singleton Pattern in C#
This should do it as well:class Singleton { public static readonly Singleton m_Instance = new Singleton(); // Prevent instance creation from other classes private Singleton() { } public static Singleton Instance { get { return m_Instance; } }}And it is "Singleton",...
This should do it as well:
class Singleton {
public static readonly Singleton m_Instance = new Singleton();
// Prevent instance creation from other classes
private Singleton() { }
public static Singleton Instance { get { return m_Instance; } }
}
And it is "Singleton", not a "single Ton"... SCNR