44 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Tutorial_5
{
public partial class Form1 : Form
{
ISubject subject;
public Form1()
{
InitializeComponent();
this.subject = new WeatherData();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void SliderChanged(object sender, EventArgs e)
{
subject.NotifyObservers();
TemperatureLabel.Text = TemperatureSlider.Value.ToString() + " ℃";
HumidityLabel.Text = HumiditySlider.Value.ToString() + " %";
PressureLabel.Text = PressureSlider.Value.ToString() + " kPa";
}
private void Form1_Load_1(object sender, EventArgs e)
{
CurrentConditionsDisplay ccd = new CurrentConditionsDisplay(this.subject);
ccd.Show();
}
}
}