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(); }
public void Visit(ErnieModem modem) { modem.ConfigurationString = "C is too slow"; }