Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic recurrence exception (Read 4417 times)
Amyuni
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Mar 11th, 2010
recurrence exception
Mar 11th, 2010 at 2:59pm
Print Post  
Hi,

I got a little confused when using the MarkException. Does MarkException create a new item added into the schedule.Items collection? If so, Does this new item has a recurrence? What is the recurrence's Master? How to exclude this item when load all items into the schedule in ItemFinder.GetAllItems?


Thanks
Amyuni
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: recurrence exception
Reply #1 - Mar 11th, 2010 at 3:34pm
Print Post  
Hi,

No, MarkException does not create new items. Instead it registers the occurrence specified as argument as an exception within its recurrence pattern. This method is also meant to programmatically delete individual occurrences from a recurrence.

If you want to "hide" (delete) specific occurrences from a recurrence pattern, you have to generate those occurrences first, by calling GenerateItems on the Recurrence object. Then, you have to invoke MarkException, passing as argument a reference to the item you wish to hide (delete). The following example demonstrates how to hide (delete) all occurrences located within a specified date interval:

Code
Select All
ItemCollection items =
      recurrence.GenerateItems(new DateTime(2010, 3, 1), new DateTime(2010, 3, 31));

foreach (Item item in items)
      recurrence.MarkException(item, true); 


Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
Amyuni
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Mar 11th, 2010
Re: recurrence exception
Reply #2 - Mar 11th, 2010 at 6:15pm
Print Post  
Thank you. My problem is how to save the updated information of exception instance. I figured it out.

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