public async void Cannot_be_not_string() { Factory.Time = "3455"; Factory.Day = DayOfWeek.Friday; var s = new CalculateTime(); await s.Calculate(); }
private async void Set_Alarm_Click(object sender, RoutedEventArgs e) { if (Factory.Time== null) MessageBox.Show("Wait a second...We need to check your schedule!", "Checking...", MessageBoxButton.OK, MessageBoxImage.Information); var start = new CalculateTime(); start.OnReady += Message; try { await start.Calculate(); } catch { MessageBox.Show("Connection with Arduino is not established.Please connect your Arduino to the computer.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }