コード例 #1
0
        public static void Main(string[] args)
        {
            SingletonDesignPattern instance = SingletonDesignPattern.GetInstance();

            instance.DisplayMessage();
            Console.ReadKey();
        }
コード例 #2
0
 public static SingletonDesignPattern GetInstance()
 {
     if (instanceOfSingleton == null)
     {
         instanceOfSingleton = new SingletonDesignPattern();
     }
     return(instanceOfSingleton);
 }