Click or drag to resize
DailyRecurrenceRule Class
Occurrences of this rule repeat on a daily basis.
Inheritance Hierarchy
SystemObject
  Kettic.AspNet.ControlsRecurrenceRule
    Kettic.AspNet.ControlsDailyRecurrenceRule

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
[SerializableAttribute]
public class DailyRecurrenceRule : RecurrenceRule

The DailyRecurrenceRule type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleDailyRecurrenceRule(Int32, RecurrenceRange)
Initializes a new instance of DailyRecurrenceRule with the specified interval (in days) and RecurrenceRange.
Public methodCode exampleDailyRecurrenceRule(RecurrenceDay, RecurrenceRange)
Initializes a new instance of DailyRecurrenceRule with the specified days of week bit mask and RecurrenceRange.
Top
Properties
  NameDescription
Public propertyDaysOfWeekMask
Gets or sets the bit mask that specifies the week days on which the event recurs.
Public propertyInterval
Gets the interval (in days) between the occurrences.
Top
Examples
using System;
using Kettic.AspNet.Controls;

namespace RecurrenceExamples
{
    class DailyRecurrenceRuleExample1
    {
        static void Main()
        {
            // Creates a sample appointment that starts at 6/1/2007 3:30 PM (local time) and lasts half an hour.
            Appointment recurringAppointment = new Appointment("1", Convert.ToDateTime("6/1/2007 3:30 PM"),
                Convert.ToDateTime("6/1/2007 4:00 PM"), "Sample appointment");

            // Creates a recurrence range, that specifies a limit of 10 occurrences for the appointment.
            RecurrenceRange range = new RecurrenceRange();
            range.Start = recurringAppointment.Start;
            range.EventDuration = recurringAppointment.End - recurringAppointment.Start;
            range.MaxOccurrences = 10;

            // Creates a recurrence rule to repeat the appointment every two days.
            DailyRecurrenceRule rrule = new DailyRecurrenceRule(2, range);

            Console.WriteLine("Appointment occurrs at the following times: ");
            int ix = 0;
            foreach (DateTime occurrence in rrule.Occurrences)
            {
                ix = ix + 1;
                Console.WriteLine("{0,2}: {1} ({2})", ix, occurrence.ToLocalTime(), occurrence.DayOfWeek);
            }
        }
    }
}

/*
This example produces the following results:

Appointment occurrs at the following times:
 1: 6/1/2007 3:30:00 PM (Friday)
 2: 6/3/2007 3:30:00 PM (Sunday)
 3: 6/5/2007 3:30:00 PM (Tuesday)
 4: 6/7/2007 3:30:00 PM (Thursday)
 5: 6/9/2007 3:30:00 PM (Saturday)
 6: 6/11/2007 3:30:00 PM (Monday)
 7: 6/13/2007 3:30:00 PM (Wednesday)
 8: 6/15/2007 3:30:00 PM (Friday)
 9: 6/17/2007 3:30:00 PM (Sunday)
10: 6/19/2007 3:30:00 PM (Tuesday)*/
See Also