Ejemplo n.º 1
0
 public static void RemoveInstance()
 {
     if (instance != null)
     {
         instance = null;
     }
 }
Ejemplo n.º 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);
        }