public override string ToString() { var text = ""; if (OccuranceType == OccuranceType.None) { text = "on the " + DayNumber.ToOrdinalString(); } else if (OccuranceType == OccuranceType.DayOfWeek) { text = "on the " + Occurance.ToString().ToLower() + " " + Day.ToString(); } else if (OccuranceType == OccuranceType.Day) { text = "on the " + Occurance.ToString().ToLower() + " day"; } else if (OccuranceType == OccuranceType.Weekday) { text = "on the " + Occurance.ToString().ToLower() + " weekday"; } if (Every == 1) { text += " of every month"; } else { text += " of every " + Every.ToString() + " months"; } return(text); }
public override string ToString() { if (Every == 1) { return("every hour between " + FromTime.ToString(@"H\:mm") + " and " + ToTime.ToString(@"H\:mm")); } else { return("every " + Every.ToString() + " hours between " + FromTime.ToString(@"H\:mm") + " and " + ToTime.ToString(@"H\:mm")); } }
public override string ToString() { var days = new List <string>(); foreach (var day in Enum.GetValues(typeof(DayOfWeek))) { if (_Days[(int)day]) { days.Add(day.ToString()); } } if (Every == 1) { return("every week on " + days.ToCommaList()); } else { return("every " + Every.ToString() + " weeks on " + days.ToCommaList()); } }