Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            var modemConfigurator = new UnixModemConfigurator();
            var hayesModem = new HayesModem();
            var zoomModem = new ZoomModem();
            var ernieModem = new ErnieModem();

            hayesModem.Accept(modemConfigurator);
            Console.WriteLine("Hayes Modem Configuration: " + hayesModem.InternalConfiguration);

            zoomModem.Accept(modemConfigurator);
            Console.WriteLine("Zoom Modem Configuration: " + zoomModem.ConfigurationValue);

            ernieModem.Accept(modemConfigurator);
            Console.WriteLine("Ernie Modem Configuration: " + ernieModem.ConfigurationString);

            Console.ReadKey();
        }
Ejemplo n.º 2
0
 public void Visit(ZoomModem modem)
 {
     modem.ConfigurationValue = 42;
 }