This tutorial shows how to programmatically create recurring items using MindFusion.Scheduling.
Follow steps 1 through 3 from the previous tutorial.
Set CurrentView to WeekRange, Date to Jan 1, 2006 and EndDate to Mar 1, 2006, respectively.
Create a new appointment in the handler of the form's Load event. To create the appointment, add the following lines of code to the body of the event handler.
Note |
---|
Be sure to include both MindFusion.Scheduling and MindFusion.Scheduling.WinForms namespace via the using keyword in the beginning of the file. |
C# Copy Code |
---|
Appointment app = new Appointment(); |
Visual Basic Copy Code |
---|
Dim app As New Appointment() |
The code above creates a new appointment on 10th of January, 2006, starting at 2:00 PM and ending at 4:30 PM.
Now that the appointment is added to the schedule, create a Recurrence object that defines how the appointment recurs. The following code creates and initializes a new Recurrence object and associates it with the item. Append these lines to the form's Load event handler.
C# Copy Code |
---|
Recurrence rec = new Recurrence(); |
Visual Basic Copy Code |
---|
Dim rec As New Recurrence() |
This fragment creates a new recurrence object that continues infinitely and repeats the appointment on Monday and Wednesday every two weeks.
Compile and run the application. The image below depicts what the application output would look like.