Exemple #1
0
        static void Main(string[] args)
        {
            ClimateControl    cc = new ClimateControl("Garage");
            TemperatureSensor ts = new TemperatureSensor();

            Console.WriteLine("It is {0} in the {1} right now",
                              cc.GetTemperature(ts), cc.ToString());

            FahrenheitReader fh  = new FahrenheitReader();
            AdapterTSensor   ats = new AdapterTSensor(fh);

            Console.WriteLine("It is {0} in the {1} right now",
                              cc.GetTemperature(ats), cc.ToString());
        }
Exemple #2
0
 public AdapterTSensor(FahrenheitReader reader)
 {
     fah = reader;
 }