Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var notifier = new SmsDecorator(new MessageNotifier());

            notifier.Send("please I need a PCI card for connect to network.", "");
            Console.ReadLine();
        }
        static void ExemploNotificador()
        {
            Console.WriteLine("Exemplo Notificador");
            var dev = new Desenvolvedor("Leandro", "*****@*****.**", "61999887766");

            dev.AssinarNotificacao(Notificacoes.SMS);
            dev.AssinarNotificacao(Notificacoes.WhastApp);

            Notificador notificador = new EmailNotificador(dev.Email);

            if (dev.PossuiAssinatura(Notificacoes.SMS))
            {
                notificador = new SmsDecorator(dev.Telefone, notificador);
            }

            if (dev.PossuiAssinatura(Notificacoes.WhastApp))
            {
                notificador = new WhatsAppDecorator(dev.Telefone, dev.Nome, notificador);
            }

            notificador.Notificar("O sistem parece estar passando por uma instabilidade. Verfique por favor!");
        }