Пример #1
0
 public static void RemoveInstance()
 {
     if (instance != null)
     {
         instance = null;
     }
 }
Пример #2
0
        public static T Instance()
        {
            if (instance == null)
            {
                lock (typeof(T))
                {
                    if (instance == null)
                    {
                        instance = Activator.CreateInstance(typeof(T), true) as T;
                    }
                }
            }

            return((T)instance);
        }