Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic remove a date from recurrence using the API (Read 4716 times)
fabian2
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Dec 1st, 2005
remove a date from recurrence using the API
Dec 20th, 2005 at 7:52pm
Print Post  
The user can delete a recurrent item from some date, but how can I do this with the API  ??? Create an exception as ur docs call it  ???

10x
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: remove a date from recurrence using the API
Reply #1 - Dec 21st, 2005 at 6:36am
Print Post  
Say you want to delete an item scheduled for Dec 21, 2005 from the first (recurrent) event in a schedule. Assuming the variable 'calendar' identifies a Planner.NET control with a recurring item in
its schedule:

Code
Select All
Item item = calendar.Schedule.Items[0];
ItemCollection items = item.Recurrence.GenerateItems(
  new DateTime(2005, 12, 21),
  new DateTime(2005, 12, 21));

if (items.Count > 0)
  item.Recurrence.MarkException(items[0], true);
calendar.Invalidate();
 



That's what happens internally when a user deletes an item from recurrent series. The control uses GenerateItems to display items in the currently visible time range, and if one of the generated items is deleted, it is marked as an exception of the recurrence.

Hope this helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint