private void Form1_Load(object sender, EventArgs e) { TemperatureController temperature = new TemperatureController(new TemperatureModel(new TemperatureDataAccess(100))); PressureController pressure = new PressureController(new PressureModel(new PressureDataAccess(100))); HumidityController humidity = new HumidityController(new HumidityModel(new HumidityDataAccess(100))); temperature.Display(new TemperatureView(new WinFormsOutput(tbTemperature))); pressure.Display(new PressureView(new WinFormsOutput(tbPressure))); humidity.Display(new HumidityView(new WinFormsOutput(tbHumidity))); }
private void Grid_Loaded(object sender, RoutedEventArgs e) { TemperatureController temperature = new TemperatureController(new TemperatureModel(new TemperatureDataAccess(100))); PressureController pressure = new PressureController(new PressureModel(new PressureDataAccess(100))); HumidityController humidity = new HumidityController(new HumidityModel(new HumidityDataAccess(100))); temperature.Display(new TemperatureView(new WpfOutput(Dispatcher, tbTemperature))); pressure.Display(new PressureView(new WpfOutput(Dispatcher, tbPressure))); humidity.Display(new HumidityView(new WpfOutput(Dispatcher, tbHumidity))); }
static void Main() { TemperatureController temperature = new TemperatureController(new TemperatureModel(new TemperatureDataAccess(100))); PressureController pressure = new PressureController(new PressureModel(new PressureDataAccess(100))); HumidityController humidity = new HumidityController(new HumidityModel(new HumidityDataAccess(100))); temperature.Display(new TemperatureView(new ConsoleOutput(0, "Temperature"))); pressure.Display(new PressureView(new ConsoleOutput(1, "Pressure"))); humidity.Display(new HumidityView(new ConsoleOutput(2, "Humidity"))); Console.ReadKey(); }