private DayType calculateDayType(DateTime dt, DayOfWeek dayOfWeek, GermanSpecialDays specialDays, out GermanSpecialDay foundSpecialDay) { foundSpecialDay = null; if (specialDays != null) { specialDays.TryGetValue(dt, out foundSpecialDay); } if (foundSpecialDay != null) { return DayType.Holiday; } DayType ret = DayType.Unknown; switch (dayOfWeek) { case DayOfWeek.Monday: case DayOfWeek.Tuesday: case DayOfWeek.Wednesday: case DayOfWeek.Thursday: case DayOfWeek.Friday: ret = DayType.Working; break; case DayOfWeek.Saturday: case DayOfWeek.Sunday: ret = DayType.Weekend; break; } // TODO: more calculations required... return ret; }
private DayType calculateDayType(DateTime dt, DayOfWeek dayOfWeek, GermanSpecialDays specialDays, out GermanSpecialDay foundSpecialDay) { foundSpecialDay = null; if (specialDays != null) { specialDays.TryGetValue(dt, out foundSpecialDay); } if (foundSpecialDay != null) { return(DayType.Holiday); } DayType ret = DayType.Unknown; switch (dayOfWeek) { case DayOfWeek.Monday: case DayOfWeek.Tuesday: case DayOfWeek.Wednesday: case DayOfWeek.Thursday: case DayOfWeek.Friday: ret = DayType.Working; break; case DayOfWeek.Saturday: case DayOfWeek.Sunday: ret = DayType.Weekend; break; } // TODO: more calculations required... return(ret); }
/* Compare-Methode für das Sortieren */ public int CompareTo(object o) { GermanSpecialDay gsd = (GermanSpecialDay)o; return(this.Date.CompareTo(gsd.Date)); }