/* * Opens a Window{ExtraType}Details to amend selected extra. */ private void lstExtras_MouseDoubleClick(object sender, MouseButtonEventArgs e) { List <BookingDecorator> extras = mFacade.GetCurrentExtras(); int i = lstExtras.SelectedIndex; if (extras != null && extras.Count == 0) { MessageBox.Show("There is no extra for this booking" + " at present."); } else if (i < 0) { MessageBox.Show("Please double click on the extra that" + " you want to edit"); } else { if (extras.ElementAt(i).GetType() == typeof(Breakfast)) { new WindowBreakfastDetails( mFacade, extras.ElementAt(i)).ShowDialog(); } else if (extras.ElementAt(i).GetType() == typeof(EveningMeal)) { new WindowEveningMealDetails( mFacade, extras.ElementAt(i)).ShowDialog(); } else if (extras.ElementAt(i).GetType() == typeof(CarHire)) { new WindowCarHireDetails( mFacade, extras.ElementAt(i)).ShowDialog(); } refreshExtrasDisplay(); } }