public static OlaMundoSingleton getInstance()
 {
     if (_instance == null)
     {
         _instance = new OlaMundoSingleton();
     }
     return(_instance);
 }
Beispiel #2
0
        static void Main(string[] args)
        {
            //Console.WriteLine("Olá Mundo");
            var factory = OlaMundoSingleton.getInstance().getFactory();
            var sub     = factory.createSubject();

            sub.attach(factory.createObserver());
            var cmd = factory.createCommand(sub);

            cmd.execute();
        }