Beispiel #1
0
        static void Main(string[] args)
        {
            CentralHub hub = new CentralHub();

            //aqui se invocarian todos los nuevos metodos
            SistemaAlarmas           alarmas          = new SistemaAlarmas();
            SistemaElectrodomesticos electrodomestico = new SistemaElectrodomesticos();
            SistemaLuces             luces            = new SistemaLuces();

            hub.Add(alarmas.EncenderAlarmas);
            hub.Add(electrodomestico.ApagarElectrodomesticos);
            hub.Add(luces.ApagarLuces);

            hub.IniciarProtocoloCierre();

            //metodo Predicado
            PredicadoDelegate pDeleg = new PredicadoDelegate();


            //Operacion ternaria
            OperacionTernaria resultado = new OperacionTernaria();

            resultado.Suma();

            Console.ReadLine();
        }
Beispiel #2
0
        // Este metodo es un "METODO ADAPTADOR" un metodo que convierte o adapta un metodo para darle una
        // firma diferente


        static void ApagarLuces()
        {
            SistemaLuces luces = new SistemaLuces();

            luces.ApagarLuces(5);
        }