protected override void OnDeactivated() {
     _dataSourceRefreshTimer.Stop();
     _dataSourceRefreshTimer.Elapsed -= RefreshTimerElapsed;
     _schedulerStorage.AppointmentChanging -= SchedulerStorageAppointmentChanging;
     _schedulerStorage.ReminderAlert -= ShowReminderAlerts;
     _dataSourceRefreshTimer = null;
     _schedulerStorage = null;
     base.OnDeactivated();
 }
 protected virtual void InitScheduler() {
     _schedulerStorage = new SchedulerStorage();
     _schedulerStorage.BeginInit();
     _schedulerStorage.EnableReminders = true;
     _schedulerStorage.RemindersCheckInterval =( ((IModelApplicationScheduler) Application.Model).Scheduler).RemindersCheckInterval;
     _appointmentStorage = (_schedulerStorage).Appointments;
     _appointmentStorage.AutoReload = false;
     var mappingCollection = _appointmentStorage.CustomFieldMappings;
     mappingCollection.Add(new AppointmentCustomFieldMapping(BoTypeCustomField, BoTypeCustomField));
     _schedulerStorage.AppointmentChanging += SchedulerStorageAppointmentChanging;
     _schedulerStorage.ReminderAlert += ShowReminderAlerts;
     _schedulerStorage.EndInit();
 }