changeset 12:d92176c5398a

Better display of schedule name.
author Brad Greco <brad@bgreco.net>
date Mon, 15 Apr 2019 19:24:55 -0400
parents 75ca86e0862c
children a36cc5c123f4
files ServerMonitor/Forms/CheckForm.cs ServerMonitor/Objects/Schedule.cs
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ServerMonitor/Forms/CheckForm.cs	Mon Apr 15 19:24:25 2019 -0400
+++ b/ServerMonitor/Forms/CheckForm.cs	Mon Apr 15 19:24:55 2019 -0400
@@ -291,7 +291,7 @@
 
         private void FrequencyUnitsComboBox_Format(object sender, ListControlConvertEventArgs e)
         {
-            e.Value = e.Value.ToString().ToLower() + 's';
+            e.Value = e.Value.ToString().ToLower() + "s";
         }
 
         private void NameTextBox_TextChanged(object sender, EventArgs e)
--- a/ServerMonitor/Objects/Schedule.cs	Mon Apr 15 19:24:25 2019 -0400
+++ b/ServerMonitor/Objects/Schedule.cs	Mon Apr 15 19:24:55 2019 -0400
@@ -64,6 +64,11 @@
             }
             return nextTime;
         }
+
+        public override string ToString()
+        {
+            return string.Format("Every {0} {1}", Frequency, Units.ToString().ToLower() + (Frequency == 1 ? "" : "s"));
+        }
     }
 
     public enum FrequencyUnits { Second, Minute, Hour, Day }