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>(); } }
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(); }
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(); }
// 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(); }
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>(); } }