You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
672 B
36 lines
672 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Observer.TemperatureObserver
|
|
{
|
|
class TrackBarForm : Form
|
|
{
|
|
private TrackBar trackBar1;
|
|
|
|
public TrackBarForm()
|
|
{
|
|
this.trackBar1 = new TrackBar();
|
|
this.trackBar1.Maximum = 100;
|
|
this.Controls.Add(this.trackBar1);
|
|
|
|
this.Load += TrackBarForm_Load;
|
|
}
|
|
|
|
private void TrackBarForm_Load(object sender, EventArgs e)
|
|
{
|
|
Temperature t = MainForm.Temp;
|
|
|
|
t.Changed += (s, eArgs) =>
|
|
{
|
|
this.Invoke(new Action(() =>
|
|
{
|
|
trackBar1.Value = (int)t.Fahrenheit % 100;
|
|
}));
|
|
};
|
|
}
|
|
}
|
|
}
|
|
|