/// <summary> /// Adds a new schedule entry. /// </summary> public static void AddEntry(this SchedulesDb db, uint id, DateTime start, DateTime end, params DayOfWeek[] days) { if (days == null || days.Length == 0) { throw new ArgumentOutOfRangeException("days", "Cannot add empty week patterns."); } db.AddEntry(id, start, end, Weekmask(days)); }
/// <summary> /// Copies the current schedule to another schedules db. /// </summary> public uint CopyTo(SchedulesDb otherDb) { var newScheduleId = otherDb.Add(); for (var pointer = _id + 1; pointer < _id + 1 + _count; pointer++) { var value = _db._data[pointer]; otherDb.AddEntry(newScheduleId, value); } return(newScheduleId); }
/// <summary> /// Adds a new schedule entry. /// </summary> public static void AddEntry(this SchedulesDb db, uint id, DateTime day) { db.AddEntry(id, day, day, day.Weekmask()); }
/// <summary> /// Adds a new schedule entry. /// </summary> public void AddScheduleEntry(uint id, DateTime start, DateTime end, byte weekMask) { _schedulesDb.AddEntry(id, start, end, weekMask); }