public void EditControlStartProperties(AuxActionRef action) { ControlStartProperties controlStartProperties = new ControlStartProperties(action); controlStartProperties.ShowDialog(); ((AuxControlStart)action).SaveProperties(controlStartProperties.Action); }
public void EditHornProperties(AuxActionRef action) { HornProperties hornProperties = new HornProperties(action); hornProperties.ShowDialog(); ((AuxActionHorn)action).SaveProperties(hornProperties.Action); }
public HornProperties(AuxActionRef action) { Action = (AuxActionHorn)action; InitializeComponent(); textBox1.Text = Action.Delay.ToString(); textBox2.Text = Action.RequiredDistance.ToString(); }
public ControlStartProperties(AuxActionRef action) { Action = (AuxControlStart)action; InitializeComponent(); textBox1.Text = Action.ActivationDelay.ToString(); textBox2.Text = Action.ActionDuration.ToString(); }
private void MouseDownUsed(object sender, MouseEventArgs e) { ListUsed.SelectedIndex = ListUsed.IndexFromPoint(e.X, e.Y); int index = ListUsed.SelectedIndex; if (e.Button == System.Windows.Forms.MouseButtons.Right) { CommentAction.Text = Program.aePreference.GetComment(Program.aePreference.AvailableActions[index]); AuxActionRef action = Program.aePreference.GetAction(index); if (action != null) { if (action.GetType() == typeof(AuxActionHorn)) { EditHornProperties(action); } else if (action.GetType() == typeof(AuxControlStart)) { EditControlStartProperties(action); } } } }
public void EditProperties(object sender, EventArgs e) { int selected = -1; // Trouver le sélectionné selected = ListUsed.SelectedIndex; if (selected >= 0) { AuxActionRef action = Program.aePreference.GetAction(selected); if (action != null) { if (action.GetType() == typeof(AuxActionHorn)) { EditHornProperties(action); } else if (action.GetType() == typeof(AuxControlStart)) { EditControlStartProperties(action); } } } }