Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic NullReferenceException (Read 6468 times)
Glacier
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Mar 10th, 2008
NullReferenceException
Jul 17th, 2008 at 1:13pm
Print Post  
I'm using Version 4.3.0.12335 on .Net 3.5 framework.  When dealing with recurrence i get the following error when it the control redraws.  Might this having anything to do with Recurrence Master?  Isn't that a readonly value or do i have to manually set that?

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at MindFusion.Scheduling.Appointment.get_Style()
   at MindFusion.Scheduling.WinForms.ScheduleItemPainter.ProcessFillSpan(Item item, Rectangle itemRect, Boolean startsHere, Boolean endsHere)
   at MindFusion.Scheduling.WinForms.ScheduleItemPainter.ProcessItem(Item item, Rectangle itemRect, Boolean startsHere, Boolean endsHere, Int32 pass)
   at MindFusion.Scheduling.WinForms.ScheduleItemProcessor.Process(DateTime startTime, DateTime endTime, Rectangle contentsBounds, TimeSpan start, TimeSpan end, TimeSpan dayStart, TimeSpan dayEnd, Resource reference)
   at MindFusion.Scheduling.WinForms.ScheduleItemPainter.Process(DateTime startTime, DateTime endTime, Rectangle contentsBounds, TimeSpan start, TimeSpan end, TimeSpan dayStart, TimeSpan dayEnd, Resource reference)
   at MindFusion.Scheduling.WinForms.ScheduleColumnCell.Draw(DrawContext context)
   at MindFusion.Scheduling.WinForms.Cell.Draw(DrawContext context)
   at MindFusion.Scheduling.WinForms.ScheduleCell.Draw(DrawContext context)
   at MindFusion.Scheduling.WinForms.Calendar.OnPaint(PaintEventArgs pe)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: NullReferenceException
Reply #1 - Jul 17th, 2008 at 1:56pm
Print Post  
The Recurrence master should have been set when you associated the recurrence with an item. Can you post the code used to create the recurring appointment and the recurrence itself?

Thank you,
Meppy
  
Back to top
 
IP Logged
 
Glacier
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Mar 10th, 2008
Re: NullReferenceException
Reply #2 - Jul 17th, 2008 at 3:03pm
Print Post  
Appointment evt = new Appointment();
evt.Recurrence = new Recurrence();

evt.Recurrence.DaysOfWeek = DaysOfWeek.All;

evt.Recurrence.StartDate = DateTime.Now;
evt.Recurrence.EndDate = DateTime.Now.AddDays(14).AddHours(1);

evt.Recurrence.RecurrenceEnd = RecurrenceEnd.EndDate;

Is this what you are looking for?

  
Back to top
 
IP Logged
 
Glacier
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Mar 10th, 2008
Re: NullReferenceException
Reply #3 - Jul 17th, 2008 at 3:16pm
Print Post  
Sorry forgot something

Appointment evt = new Appointment();
evt.Recurrence = new Recurrence();

Recurrence rec=new Recurrence();

rec.DaysOfWeek = DaysOfWeek.All;
evt.Recurrence=rec;

evt.Recurrence.StartDate = DateTime.Now;
evt.Recurrence.EndDate = DateTime.Now.AddDays(14).AddHours(1);

evt.Recurrence.RecurrenceEnd = RecurrenceEnd.EndDate;

Might the problem be that the recurrence isn't being associated correctly?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: NullReferenceException
Reply #4 - Jul 17th, 2008 at 3:39pm
Print Post  
Unfortunately this code works correctly here and does not cause the abovementioned exception to be thrown. Can you also supply me with the settings of your Calendar control, that is, the properties you have changed and their new values?

Meppy
  
Back to top
 
IP Logged
 
Glacier
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Mar 10th, 2008
Re: NullReferenceException
Reply #5 - Jul 17th, 2008 at 5:18pm
Print Post  
Did have another idea.  If the rendering code is being done a seperate thread then it maybe that i'm changing some recurrence properties while its trying to redraw and this might be how the problem is coming about.  So does the rendering occur on a seperate thread?
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: NullReferenceException
Reply #6 - Jul 18th, 2008 at 6:44am
Print Post  
Nope, everything is done in the main thread. Can you provide me with more details about your Calendar settings so that I can reproduce the bug here?

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