Skip Navigation LinksHome : Submit Snippet : Snippet Search : Snippet Detail
Snippet language icon

Author:
Simone Chiaretta

Submitted:
02 Sep 2006

Language:
C#



Snippet Detail and Download

Snippet Type(s):  Expansion
Abstract (from author):
This snippets creates a Singleton Class, as a result of the discussion happened on this post of mine: http://blogs.ugidotnet.org/piyo/archive/2005/09/14/Singleton_C_NET.aspx


Description (from snippet):
Creates a Singleton Class following the discussion on that post of mine: http://blogs.ugidotnet.org/piyo/archive/2005/09/14/Singleton_C_NET.aspx


Code Block:
1 public sealed class $className$ 2 { 3 private readonly static $className$ _instance = new $className$(); 4 5 public static $className$ Current 6 { 7 get 8 { 9 return _instance; 10 } 11 } 12 13 private $className$() 14 { 15 //Implent here the initialization of your singleton 16 } 17 }
Download Now!
Download the snippet file by clicking the download button below. You may customize the snippet shortcut prior to downloading below.

Shortcut:

The download is in Visual Studio Community Content Installer (VSI) format.