public static int IncrementCounter()
 {
     if (instance == null)
     {
         lock (padlock)
         {
             if (instance == null)
                 instance = new Singleton();
         }
     }
     return instance.counter++;
 }
コード例 #2
0
		public override void HandleSingleton(CompositionBatch batch, Singleton singleton)
		{
			batch.AddPart(new ProxyPart(singleton, CreatePart(singleton)));
		}