Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Changes to Recurrence Class members with v 4.1 (Read 2636 times)
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Changes to Recurrence Class members with v 4.1
Nov 19th, 2007 at 8:25pm
Print Post  
Just to be clear on this change you guys have made to Recurrence class members (starting with v 4.1): Essentially, you have consolidated the 3 time components StartDate, StartHour, and StartMinutes into the single StartDate property. Likewise for the EndDate. Is this correct?

Then the StartDate and EndDate Properties of a Recurrence are the equivalent of the StartTime and EndTime Properties of its associated Apppointment. So when I programmatically create a (new) Recurrence for an Appointment, I should initialize the values for its Start- and EndDates to the Appointment's Start- and EndTimes.  Is this also correct?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Changes to Recurrence Class members with v 4.1
Reply #1 - Nov 20th, 2007 at 6:41am
Print Post  
Indeed we made some changes on how the Recurrence pattern works. The old properties StartHour/StartMinute and EndHour/EndMinute are now automatically obtained from the item the recurrence is associated with. The StartDate property of the recurrence specifies the date from which the recurrence should start, that is, the date of the first item occurrence. The EndDate property specifies the date when the recurrence should, and is only used if the RecurrenceEnd is set to EndDate.

In general, StartDate and EndDate of the recurrence pattern define the time interval where the occurrences of this recurrence will appear. The length of each occurrence and its relative start and and times are automatically obtained from the original item.

Meppy
  
Back to top
 
IP Logged
 
BudMan
YaBB Newbies
*
Offline


Credidi me felem vidisse

Posts: 45
Joined: Jul 14th, 2007
Re: Changes to Recurrence Class members with v 4.1
Reply #2 - Nov 20th, 2007 at 2:13pm
Print Post  
Ah, but only if I use your 'ready-made' form from the StandardForms class library to generate the Recurrence. I am trying to do this programmatically with my own forms. Specifically, I am trying to create a recurrence from an existing appointment. For example, I must somehow assign initial values for the Recurrence object so it displays a start date and time in the respective controls. Apparently, I do this by extracting the Date and Time components from the Appointment's StartTime property. Is this correct?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Changes to Recurrence Class members with v 4.1
Reply #3 - Nov 21st, 2007 at 6:05am
Print Post  
I was talking about setting up the recurrence programmatically as well. Lets say you have an item which starts at 10:00 AM on 21st of November, 2007 and ends at 12:00 AM on the same day. In order to make this item recurrent (with the first occurrence being the item itself), you create the following recurrence (a references the item being made recurrent):

Code
Select All
// Create the recurrence
Recurrence r = new Recurrence();
r.StartDate = a.StartTime.Date;
r.Pattern = RecurrencePattern.Daily;
r.Days = 2;
r.RecurrenceEnd = RecurrenceEnd.Never;

// Assign the recurrence
a.Recurrence = r; 


As you can see, the recurrence pattern is defined much more easily than it was in the previous versions. Also notice that the EndDate property is never used, since the recurrence is infinite.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint