SingletonBase.cs 282 B

12345678910111213141516
  1. public class SingletonBase<T> where T : new()
  2. {
  3. private static T instance;
  4. public static T Instance
  5. {
  6. get
  7. {
  8. if (instance == null)
  9. {
  10. instance = new T();
  11. }
  12. return instance;
  13. }
  14. }
  15. }
粤ICP备19079148号