private void EditAction() { if (grdDataView.SelectedRowsCount <= 0) { MessageBox.Show("You must select the action you want to edit.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { if (grdDataView.GetRow(grdDataView.GetSelectedRows()[0]) is ElementAction action) { ActionEditorView form = new ActionEditorView(this.OwnerElement, action); if (form.ShowDialog(this) == DialogResult.OK) { this.Refresh(); } } } catch (System.Exception ex) { MessageBox.Show("ERROR loading data: " + ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void AddAccessoryAction() { ElementAction action = new ElementAction(); action.Element = this.OwnerElement; action.Type = ElementAction.ActionTypes.SetAccessoryStatus; ActionEditorView form = new ActionEditorView(this.OwnerElement, action); if (form.ShowDialog(this) == DialogResult.OK) { this.Refresh(); } }
private void AddRouteAction() { ElementAction action = new ElementAction(); action.Element = this.OwnerElement; action.Type = ElementAction.ActionTypes.ActivateRoute; ActionEditorView form = new ActionEditorView(this.OwnerElement, action); form.ShowDialog(this); if (form.DialogResult == DialogResult.OK) { this.Refresh(); } }