예제 #1
0
 private void _tb_OnKeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         if (TryParse(SelectedType, _tb.Text))
         {
             Conditions = new Tuple <Type, string>(SelectedType, _tb.Text);
             ConditionsChanged?.Invoke(Conditions.Item1, Conditions.Item2);
         }
     }
 }
예제 #2
0
 public void Start()
 {
     for (int i = 0; i < 3; i++)
     {
         Thread.Sleep(dice.Next(1, 6) * 1000);
         temperature = dice.NextDouble() * 50;
         pressure    = dice.NextDouble() * 50;
         humidity    = dice.NextDouble() * 50;
         Console.WriteLine($"T: {temperature}, P: {pressure}, H: {humidity}");
         ConditionsChanged?.Invoke(temperature, pressure, humidity);
         //update(temperature, pressure, humidity);
     }
 }
예제 #3
0
 private void OnClearClick(object sender, RoutedEventArgs e)
 {
     Conditions = null;
     ConditionsChanged?.Invoke(null, null);
 }
예제 #4
0
 protected virtual void OnConditionsChanged(object sender, ConditionsChangedEventArgs ea)
 {
     ConditionsChanged?.Invoke(sender, ea);
 }