Пример #1
0
 public static void DestroySingleton()
 {
     if (SINGLETON_InstrumentMaster != null)
     {
         SINGLETON_InstrumentMaster = null;
     }
     else
     {
         throw new InvalidOperationException("Singleton has already been destroyed");
     }
 }
Пример #2
0
 public static void CreateSingleton()
 {
     if (SINGLETON_InstrumentMaster == null)
     {
         SINGLETON_InstrumentMaster = new InstrumentMaster();
     }
     else
     {
         throw new InvalidOperationException("Singleton has already been initialized");
     }
 }