Snippet: Singleton class

property value
IDE VS Code
Language C#
Title Singleton class
Shortcut c_Singleton
Description class that implements singleton pattern

Placeholders

Identifier Tooltip Default Value
modifier Modifier(s) public sealed
name Class name ClassName
value Value to assign value

Code

public sealed class ClassName {
	private static readonly ClassName _instance = value;

	private ClassName() {
	}

	public static ClassName Instance {
		get { return _instance; }
	}
}