예제 #1
0
        /// <summary>
        ///     Triggered when the "Properties" button is clicked for the selected train type
        /// </summary>
        /// <param name="sender">Control that initiated the event</param>
        /// <param name="eventArgs">Arguments associated with this event</param>
        private void OnTrainTypePropertiesButtonClick(object sender, EventArgs eventArgs)
        {
            using (var dialog = new TrainTypePropertiesDialog(Train.Type))
                dialog.ShowDialog(this);

            PopulateTrainTypes();
            UpdateControlState();
        }
예제 #2
0
        /// <summary>
        ///     Triggered when the "Add" train type button is clicked
        /// </summary>
        /// <param name="sender">Control that initiated the event</param>
        /// <param name="eventArgs">Arguments associated with this event</param>
        private void OnAddNewTypeButtonClick(object sender, EventArgs eventArgs)
        {
            using (var dialog = new TrainTypePropertiesDialog(new TrainType())) {
                if (dialog.ShowDialog(this) != DialogResult.Cancel)
                {
                    Train.Type = dialog.TrainType;
                }
            }

            PopulateTrainTypes();
            UpdateControlState();
        }
예제 #3
0
 /// <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 TrainTypePropertiesDialog((TrainType)target))
         dialog.ShowDialog(this);
     RenderItems();
 }
예제 #4
0
 /// <summary>
 ///     Triggered when the "Insert" operation is requested
 /// </summary>
 public override void OnQueryInsert()
 {
     using (var dialog = new TrainTypePropertiesDialog(new TrainType()))
         dialog.ShowDialog(this);
     RenderItems();
 }