Advertisement
ivandrofly

Singleton Class

Feb 1st, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. class Program
  2. {
  3.     static void Main()
  4.     {
  5.     SiteStructure s = SiteStructure.Instance;
  6.     }
  7. }
  8.  
  9. public sealed class SiteStructure
  10. {
  11.     static readonly SiteStructure _instance = new SiteStructure();
  12.     public static SiteStructure Instance
  13.     {
  14.     get
  15.     {
  16.         return _instance;
  17.     }
  18.     }
  19.     SiteStructure()
  20.     {
  21.     // Initialize.
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement