18 lines
		
	
	
		
			341 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			341 B
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | 
 | |||
|  | public abstract class NormalSingleton<T> where T : NormalSingleton<T>, new() | |||
|  | { | |||
|  |     private static T mInstance = null; | |||
|  |     public static T Instance | |||
|  |     { | |||
|  |         get | |||
|  |         { | |||
|  |             if (mInstance == null) | |||
|  |             { | |||
|  |                 mInstance = new T(); | |||
|  |             } | |||
|  | 
 | |||
|  |             return mInstance; | |||
|  |         } | |||
|  |     } | |||
|  | } |