private void deleteToolStripMenuItem2_Click(object sender, EventArgs e) { if (dgTriggerEvents.MultiSelect == true) { throw new NotImplementedException("Editing mutliple triggers at once is unsupported."); } VI_Trigger selected_trigger = null; foreach (DataGridViewRow row in this.dgTriggers.SelectedRows) { selected_trigger = row.DataBoundItem as VI_Trigger; } if (selected_trigger != null) { foreach (DataGridViewRow row in this.dgTriggerEvents.SelectedRows) { VI_TriggerEvent selected_event = row.DataBoundItem as VI_TriggerEvent; if (selected_event != null) { //Remove Event selected_trigger.Remove(selected_event); } } } ProfileEdited(); refresh_dgTriggers(); refresh_dgTriggerEvents(); }
public frmAddtoTriggerEvent(VI_TriggerEvent event_to_add) { InitializeComponent(); MaximizeBox = false; this.event_to_add = event_to_add; cbAddtoTriggerEvent.DataSource = GAVPI.vi_profile.Profile_Triggers.ToArray(); cbAddtoTriggerEvent.DisplayMember = "name"; }
public frm_Add_to_TriggerEvent( VI_TriggerEvent event_to_add ) { InitializeComponent(); MaximizeBox = false; this.event_to_add = event_to_add; cbAddtoTriggerEvent.DataSource = GAVPI.vi_profile.Profile_Triggers.ToArray(); cbAddtoTriggerEvent.DisplayMember = "name"; }
// Add Trigger to TriggerEvent private void addtoeventToolStripMenuItem1_Click(object sender, EventArgs e) { if (dgTriggers.MultiSelect == true) { throw new NotImplementedException("Adding multiple triggers at once is unsupported."); } foreach (DataGridViewRow row in this.dgTriggers.SelectedRows) { // In this case it is a Trigger -> Trigger addition VI_TriggerEvent event_to_add = row.DataBoundItem as VI_TriggerEvent; frm_Add_to_TriggerEvent newAddtoTriggerEvent = new frm_Add_to_TriggerEvent(event_to_add); if (newAddtoTriggerEvent.ShowDialog() == DialogResult.OK) { ProfileEdited(); } } refresh_dgTriggerEvents(); }
public bool Remove(VI_TriggerEvent tevent) { return(TriggerEvents.Remove(tevent)); }
public void Add(VI_TriggerEvent tevent) { TriggerEvents.Add(tevent); }
public bool Remove(VI_TriggerEvent tevent) { return TriggerEvents.Remove(tevent); }