Esempio n. 1
0
 public static UniqueIdGenerator GetInstance()
 {
     lock (Lock)
     {
         if (_instance == null)
         {
             _instance = new UniqueIdGenerator();
         }
     }
     return(_instance);
 }
Esempio n. 2
0
 public static void Configure(string firstId)
 {
     lock (Lock)
     {
         if (_instance == null)
         {
             _instance = new UniqueIdGenerator(firstId);
         }
         else
         {
             throw new InvalidOperationException("Object already exist");
         }
     }
 }