示例#1
0
        /// <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));
        }
示例#2
0
            /// <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);
            }
示例#3
0
 /// <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());
 }
示例#4
0
 /// <summary>
 /// Adds a new schedule entry.
 /// </summary>
 public void AddScheduleEntry(uint id, DateTime start, DateTime end, byte weekMask)
 {
     _schedulesDb.AddEntry(id, start, end, weekMask);
 }