private void AppointmentslistBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Constants.DefaultInitialIndex <= appointmentsListBox.SelectedIndex && appointmentsListBox.SelectedIndex < appointments.Count)
     {
         AppointmentInformationForm appointmentInformationForm = new AppointmentInformationForm(appointments[appointmentsListBox.SelectedIndex]);
         appointmentInformationForm.Show();
     }
 }
 private void InvitedAppointmentsListBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (Constants.DefaultInitialIndex <= invitedAppointmentsListBox.SelectedIndex && invitedAppointmentsListBox.SelectedIndex < invitedAppointments.Count)
     {
         AppointmentInformationForm appointmentInformationForm = new AppointmentInformationForm(invitedAppointments[invitedAppointmentsListBox.SelectedIndex],
                                                                                                calendar, appointmentController, userController, this);
         appointmentInformationForm.Show();
     }
 }