Exemplo n.º 1
0
        public void EditControlStartProperties(AuxActionRef action)
        {
            ControlStartProperties controlStartProperties = new ControlStartProperties(action);

            controlStartProperties.ShowDialog();
            ((AuxControlStart)action).SaveProperties(controlStartProperties.Action);
        }
Exemplo n.º 2
0
        public void EditHornProperties(AuxActionRef action)
        {
            HornProperties hornProperties = new HornProperties(action);

            hornProperties.ShowDialog();
            ((AuxActionHorn)action).SaveProperties(hornProperties.Action);
        }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 5
0
        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);
                    }
                }
            }
        }
Exemplo n.º 6
0
        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);
                    }
                }
            }
        }