diff ServerMonitor/Forms/CheckForm.cs @ 4:3142e52cbe69

Lots more progress
author Brad Greco <brad@bgreco.net>
date Sun, 10 Feb 2019 20:51:26 -0500
parents 9e92780ebc0f
children 052aa62cb42a
line wrap: on
line diff
--- a/ServerMonitor/Forms/CheckForm.cs	Fri Jan 11 22:34:18 2019 -0500
+++ b/ServerMonitor/Forms/CheckForm.cs	Sun Feb 10 20:51:26 2019 -0500
@@ -28,7 +28,7 @@
 
         public int CheckId { get; private set; }
 
-        public Point HelpLocation { get { return TypeHelpPictureBox.PointToScreen(Point.Empty); } }
+        public Point HelpLocation => TypeHelpPictureBox.PointToScreen(Point.Empty);
 
         public CheckForm(ServerMonitor monitor, Check check)
         {
@@ -50,6 +50,8 @@
         private void CheckForm_Load(object sender, EventArgs e)
         {
             CheckTypeComboBox.Items.AddRange(Check.CheckTypes);
+            SeverityComboBox.Items.AddRange(new object[] { CheckStatus.Error, CheckStatus.Warning, CheckStatus.Information });
+            SeverityComboBox.SelectedIndex = 0;
             FrequencyUnitsComboBox.DataSource = Enum.GetValues(typeof(FrequencyUnits));
             Helpers.FormatImageButton(RunButton);
             Helpers.FormatImageButton(CancelRunButton);
@@ -115,6 +117,7 @@
             NameTextBox.Text = Check.Name;
             EnabledCheckBox.Checked = check.Enabled;
             TimeoutInput.Value = check.Timeout;
+            SeverityComboBox.SelectedItem = check.FailStatus;
             FrequencyUnitsComboBox.SelectedItem = check.Schedule.Units;
             FrequencyUpDown.Value = check.Schedule.Frequency;
             StartTimePicker.Value = new DateTime(1970, 1, 1) + check.Schedule.StartTime;
@@ -136,6 +139,7 @@
                 check.Name = NameTextBox.Text;
                 check.Enabled = EnabledCheckBox.Checked;
                 check.Timeout = (int)TimeoutInput.Value;
+                check.FailStatus = (CheckStatus)SeverityComboBox.SelectedItem;
                 check.Schedule = new Schedule((FrequencyUnits)FrequencyUnitsComboBox.SelectedItem, (int)FrequencyUpDown.Value, StartTimePicker.Value.TimeOfDay, EndTimePicker.Value.TimeOfDay);
                 try
                 {