Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Calendar throws an out of memory exception. (Read 4677 times)
jovi
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Aug 12th, 2009
Calendar throws an out of memory exception.
Nov 12th, 2009 at 6:02pm
Print Post  
Hello,

I am using PocketPlanner control, version 4.5, under Windows CE 6.0 R3, and I am getting an out of memory exception. I was able to reproduce the error in a sample application:

1- I added an Appointment with a recurrence like this:

Appointment _Appointment = new Appointment();
           _Appointment.HeaderText = "Testing...";
           _Appointment.Subject = "Testing...";
           _Appointment.DescriptionText = "Testing...";
           _Appointment.StartTime = DateTime.Now.AddHours(2);
           _Appointment.EndTime = DateTime.Now.AddHours(3);
           _Appointment.Attendees.Add(fCalendar.Contacts[0]);

           Recurrence _Recurrence = new Recurrence();
           _Recurrence.Pattern = RecurrencePattern.Daily;
           _Recurrence.Days = 2;
           _Recurrence.StartDate = _Appointment.StartTime;
           _Recurrence.RecurrenceEnd = RecurrenceEnd.Never;

_Appointment.Recurrence = _Recurrence;

           fCalendar.Schedule.Items.Add(_Appointment);

2- I set up CurrentView to WeekRange view in SingleWeek mode.

3- I have 2 buttons to "scroll" one week forward or backward, like this:
        private void fbPreviousWeek_Click(object sender, EventArgs e)
       {
           fCalendar.Date = fCalendar.Date.AddDays(-7);
       }

       private void fbNextWeek_Click(object sender, EventArgs e)
       {
           fCalendar.Date = fCalendar.Date.AddDays(7);
       }


4- After a few clicks on the "Next" button the application freeze and the exception is thrown. On the problematic screen, all the cells without schedule items could not be drawn.

Could you please tell me if I am doing something wrong or if this is a bug in the control?

Best regards.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Calendar throws an out of memory exception.
Reply #1 - Nov 16th, 2009 at 7:46am
Print Post  
Try also to increase/decrease the end time of the Calendar:

Code
Select All
 private void fbPreviousWeek_Click(object sender, EventArgs e)
{
      fCalendar.Date = fCalendar.Date.AddDays(-7);
      fCalendar.EndDate = fCalendar.Date.AddDays(-7);
}

private void fbNextWeek_Click(object sender, EventArgs e)
{
      fCalendar.Date = fCalendar.Date.AddDays(7);
      fCalendar.EndDate = fCalendar.Date.AddDays(7);
} 


Otherwise, Date becomes larger than EndDate at some point and the recurrence attempts to generate occurrences in an undefined interval, which causes the exception.

Meppy
  
Back to top
 
IP Logged
 
jovi
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Aug 12th, 2009
Re: Calendar throws an out of memory exception.
Reply #2 - Nov 17th, 2009 at 3:50pm
Print Post  
Yes, that fixed it. Thanks Meppy!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint