public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendFormat($"Name: {Name}").AppendLine(); sb.AppendFormat($"Status: {Status}").AppendLine(); sb.AppendFormat($"HealthType: {HealthType}").AppendLine(); sb.AppendFormat($"Result Time: {ResultTime.ToString("yyyy-MM-dd HH:mm")}").AppendLine(); sb.AppendFormat($"UTC Time: {ResultTime.ToString("U")}").AppendLine(); sb.AppendFormat($"Message: {Message}").AppendLine(); return(MessageBuilder.ToString()); }
private void TimeTextbox_TextChanged(object sender, EventArgs e) { int ResultTime; if (!int.TryParse(TimeTextbox.Text, out ResultTime)) { TimeTextbox.BackColor = Color.LightPink; StartButton.Enabled = false; } else { TimeTextbox.BackColor = Color.White; Properties.Settings.Default.TimeDefault = ResultTime.ToString(); StartButton.Enabled = true; } }