That solved the NullReferenceException error, but now I get another error when I call the ResolveAppointments method.
DayView1.ResolveAppointments()
Error 1 'Public Event ResolveAppointments(sender As Object, args As Calendar.ResolveAppointmentsEventArgs)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event. C:\Users\Daniel\My Programs\Visual Basic\SeaCow\SeaCow\SeaCow\Main.vb 224 9 SeaCow
Here is the ResolveAppointments function from the DayView.cs file.
protected virtual void ResolveAppointments(ResolveAppointmentsEventArgs args)
{
System.Diagnostics.Debug.WriteLine("Resolve app");
if (OnResolveAppointments != null)
OnResolveAppointments(this, args);
this.allDayEventsHeaderHeight = 0;
// cache resolved appointments in hashtable by days.
cachedAppointments.Clear();
if ((selectedAppointmentIsNew) && (selectedAppointment != null))
{
if ((selectedAppointment.StartDate > args.StartDate) && (selectedAppointment.StartDate < args.EndDate))
{
args.Appointments.Add(selectedAppointment);
}
}
foreach (Appointment appointment in args.Appointments)
{
int key = -1;
AppointmentList list;
if (appointment.StartDate.Day == appointment.EndDate.Day && appointment.AllDayEvent == false)
{
key = appointment.StartDate.Day;
}
else
{
key = -1;
}
list = (AppointmentList)cachedAppointments[key];
if (list == null)
{
list = new AppointmentList();
cachedAppointments[key] = list;
}
list.Add(appointment);
}
}