예제 #1
0
        private void populate_fields()
        {
            // Fill combo-box with possible action types.
            cbActionType.DataSource = Action_Groups; //Used to be ActionSequence.Types (now we group them into forms)

            // Null the data grid, later we will bind actions to it (as list)
            dgActionSequence.DataSource = null;

            // if we have a sequence to edit, populate the fields with existing values
            if (sequence_to_edit != null)
            {
                txtActionSequenceName.Text = sequence_to_edit.name;

                // TODO : Hack
                //
                dgActionSequence.DataSource = sequence_to_edit.action_sequence.ToList();

                txtActionSequenceComment.Text = sequence_to_edit.comment;
                chkRandomExecution.Checked    = sequence_to_edit.random_exec;
            }
            // Otherwise just init new attributes.
            else
            {
                this.sequence_to_edit       = new Action_Sequence();
                dgActionSequence.DataSource = new List <Action>();
            }
        }
예제 #2
0
        public frm_AddEdit_ActionSequence(Action_Sequence action_sequence)
        {
            // Passing an action sequence edits the passed sequence.
            InitializeComponent();

            this.sequence_to_edit = action_sequence;

            populate_fields();
        }
        public frm_AddEdit_ActionSequence( Action_Sequence action_sequence )
        {
            // Passing an action sequence edits the passed sequence.
            InitializeComponent();

            this.sequence_to_edit = action_sequence;

            populate_fields();
        }
예제 #4
0
        private void EditActionSequence()
        {
            if (dgActionSequences.MultiSelect == true)
            {
                throw new NotImplementedException("Editing multiple sequences at once is unsupported.");
            }
            foreach (DataGridViewRow row in this.dgActionSequences.SelectedRows)
            {
                Action_Sequence            sequence_to_edit  = row.DataBoundItem as Action_Sequence;
                frm_AddEdit_ActionSequence newActionSequence = new frm_AddEdit_ActionSequence(sequence_to_edit);

                if (newActionSequence.ShowDialog() == DialogResult.OK)
                {
                    ProfileEdited();
                }
            }
            refresh_dgActionSequences();
            refresh_dgTriggerEvents();
        }
예제 #5
0
        // Delete Action Sequence
        private void deleteToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            if (dgActionSequences.MultiSelect == true)
            {
                throw new NotImplementedException("Multiple sequence deletions are unsupported.");
            }
            foreach (DataGridViewRow row in this.dgActionSequences.SelectedRows)
            {
                Action_Sequence sequence_to_remove = row.DataBoundItem as Action_Sequence;
                GAVPI.Profile.Profile_ActionSequences.Remove(sequence_to_remove);

                // Remove this event from existing triggers.
                foreach (Trigger existing_trigger in GAVPI.Profile.Profile_Triggers)
                {
                    existing_trigger.TriggerEvents.Remove(sequence_to_remove);
                }
            }
            refresh_dgActionSequences();
            refresh_dgTriggerEvents();

            ProfileEdited();
        }
예제 #6
0
파일: Action.cs 프로젝트: zhuangzard/AVPI
 public Or(Action_Sequence actions, string value) : base(value)
 {
     this.actions = actions;
 }
        private void populate_fields()
        {
            // Fill combo-box with possible action types.
            cbActionType.DataSource = Action_Groups; //Used to be ActionSequence.Types (now we group them into forms)

            // Null the data grid, later we will bind actions to it (as list)
            dgActionSequence.DataSource = null;

            // if we have a sequence to edit, populate the fields with existing values
            if (sequence_to_edit != null)
            {
                txtActionSequenceName.Text = sequence_to_edit.name;

                // TODO : Hack
                //
                dgActionSequence.DataSource = sequence_to_edit.action_sequence.ToList();

                txtActionSequenceComment.Text = sequence_to_edit.comment;
            }
            else
            {
                this.sequence_to_edit = new Action_Sequence();

                dgActionSequence.DataSource = new List<Action>();
            }
        }