Janusys scheduler problem, when adding a bunch of appointments

106 Views Asked by At

First of all, I know, that Janusys components already died and there is no official support anymore.

But, maybe someone has an idea, of how I can resolve this issue. I use the lates available build 4.0.51 (WinForms)

I use the following code to add appointments to my scheduler:

            RemoveHandler Me.Scheduler.AppointmentAdded, AddressOf Me.Schedule_AppointmentAdded
            RemoveHandler Me.Scheduler.Reminder, AddressOf Me.Schedule_Reminder
            RemoveHandler Me.Scheduler.AppointmentChanged, AddressOf Me.Schedule_AppointmentChanged
            RemoveHandler Me.Scheduler.DoubleClick, AddressOf Me.Schedule_DoubleClick
            RemoveHandler Me.Scheduler.AppointmentDoubleClick, AddressOf Me.Schedule_AppointmentDoubleClick

            Dim locCountOfAppontments = locAppointments.Count
            Dim locCurrentAppointmentIndex = 0
            Dim locMyDays = Scheduler.DayColumns

            Me.Scheduler.Enabled = False

            locAppointments.ForEach(Sub(appointment)
                                        Dim locNewScheduleAppointment = New ScheduleAppointment(appointment.StartOfAppointment,
                                                                                            appointment.EndOfAppointment,
                                                                                            appointment.Title)

                                        locNewScheduleAppointment.Key = appointment.Id
                                        locNewScheduleAppointment.Description = appointment.LongText
                                        locNewScheduleAppointment.Owner = Int64.Parse(appointment.EmployeeId)
                                        locNewScheduleAppointment.Reminder.Enabled = If(appointment.Reminder.HasValue, appointment.Reminder.Value, True)
                                        If String.IsNullOrEmpty(appointment.Layout) = False Then
                                            locNewScheduleAppointment.SettingsInfo = appointment.Layout
                                        End If
                                        If String.IsNullOrEmpty(appointment.Recurrency) = False Then
                                            locNewScheduleAppointment.RecurrencePatternInfo = appointment.Recurrency
                                        End If

                                        Me.Scheduler.Appointments.Add(locNewScheduleAppointment)

                                        If IsNothing(appointment.CategoryId) = False Then
                                            locNewScheduleAppointment.SetValue("CategoryId", appointment.CategoryId)
                                        End If

                                        locCurrentAppointmentIndex += 1
                                    End Sub)
            Me.Scheduler.Enabled = True
            Me.CreateFormatConditions()
            Me.FillOwners()

            RaiseEvent ReportAddingAppointmentsFinished()
            Scheduler.DayColumns = locMyDays
            myIsInitalizingData = False
            AddHandler Me.Scheduler.AppointmentAdded, AddressOf Me.Schedule_AppointmentAdded
            AddHandler Me.Scheduler.Reminder, AddressOf Me.Schedule_Reminder
            AddHandler Me.Scheduler.AppointmentChanged, AddressOf Me.Schedule_AppointmentChanged
            AddHandler Me.Scheduler.DoubleClick, AddressOf Me.Schedule_DoubleClick
            AddHandler Me.Scheduler.AppointmentDoubleClick, AddressOf Me.Schedule_AppointmentDoubleClick
            Me.Scheduler.EndEdit()

I have about 500 appointments and almost every appointment has a recurrency pattern, so I have to load all appointments. The problem is, that the add routine is getting slower on each call. The first 20 appointments are added under one second, but at appointment 150, it already needs about a second for a single appointment to get added. What I already tried is to execute the above code in a seperate thread, what is working, but not speeding up the scenario.

The scheduler isn't bound to any calender. The schedular is on a usercontrol.

THX a lot

0

There are 0 best solutions below