11.11.2015

Singelton in C#

#region Singleton
       private static xxx _instance;

       private xxx() { }

       public static xxx Instance
       {
           get
           {
               if (_instance == null)
               {
                   _instance = new xxx();
               }
               return _instance;
           }
       }
       #endregion

Keine Kommentare: