/// <summary> /// Triggered when the "Properties" button is clicked for the selected train /// </summary> /// <param name="sender">Control that initiated the event</param> /// <param name="eventArgs">Arguments associated with this event</param> private void OnTrainPropertiesButtonClick(object sender, EventArgs eventArgs) { using (var dialog = new TrainPropertiesDialog(Trip.Train)) dialog.ShowDialog(this); PopulateTrains(); UpdateControlState(); }
/// <summary> /// Triggered when the "Add" train button is clicked /// </summary> /// <param name="sender">Control that initiated the event</param> /// <param name="eventArgs">Arguments associated with this event</param> private void OnAddNewTrainButtonClick(object sender, EventArgs eventArgs) { using (var dialog = new TrainPropertiesDialog(new Train())) { if (dialog.ShowDialog(this) != DialogResult.Cancel) { Trip.Train = dialog.Train; } } PopulateProducts(); UpdateControlState(); }
/// <summary> /// Triggered when the "Properties" operation is requested /// </summary> /// <param name="target">The list view item associated with the request</param public override void OnQueryProperties(object target) { using (var dialog = new TrainPropertiesDialog((Train)target)) dialog.ShowDialog(this); RenderItems(); }
/// <summary> /// Triggered when the "Insert" operation is requested /// </summary> public override void OnQueryInsert() { using (var dialog = new TrainPropertiesDialog(new Train())) dialog.ShowDialog(this); RenderItems(); }