void pAction_OnActionListDescriptionChanged(DmxFramework.Midi.Action.ActionList pActionList, string pDescription) { foreach (DataGridViewRow row in dataGridView1.Rows) { if (row.Tag == pActionList) { row.Cells[4].Value = pDescription; } } }
public Action.ActionList AddOrGetAction(string pName, string pCommand, int pMidiChannel, int pData1) { string key = Action.Action.GetKey(pName, pCommand, pMidiChannel, pData1); Action.ActionList Actlist; if (mActionTable.TryGetValue(key, out Actlist)) { return(Actlist); } Actlist = new DmxFramework.Midi.Action.ActionList(pName, pCommand, pMidiChannel, pData1); mActionTable.Add(Actlist.Key, Actlist); return(Actlist); }
internal void LoadXml(XmlNode pNode) { if (pNode.Name != Constant.MidiXmlNodeName) { return; } foreach (XmlNode node in pNode.ChildNodes) { Action.ActionList actList = new DmxFramework.Midi.Action.ActionList(node); mActionTable.Add(actList.Key, actList); } }
void AddRow(DmxFramework.Midi.Action.ActionList pAction) { DataGridViewRow row; int RowIndex = dataGridView1.Rows.Add(); row = dataGridView1.Rows[RowIndex]; row.Cells[0].Value = pAction.DeviceName; row.Cells[1].Value = pAction.Command; row.Cells[2].Value = pAction.MidiChannel; row.Cells[3].Value = pAction.Data1; row.Cells[4].Value = pAction.Description; row.Cells[5].Value = "Delete"; row.Tag = pAction; pAction.OnActionListDescriptionChanged += new DmxFramework.Midi.Action.OnActionListDescriptionChangedEvent(pAction_OnActionListDescriptionChanged); }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { if (mDeviceName == "") { MessageBox.Show(this, "You must to select a midi usng your midi device to add an action", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DmxFramework.Midi.Action.ActionList Action = new DmxFramework.Midi.Action.ActionList(mDeviceName, mCommand, mMidiChannel, mData1); if (Framework.MidiDriver.ActionTable.ContainsKey(Action.Key)) { MessageBox.Show(this, "this action is already set", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Framework.MidiDriver.ActionTable.Add(Action.Key, Action); AddRow(Action); if (OnActionListSelected != null) { OnActionListSelected(Action); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0) { return; } DmxFramework.Midi.Action.ActionList Action = (DmxFramework.Midi.Action.ActionList)dataGridView1.Rows[e.RowIndex].Tag; if (e.ColumnIndex == 5) { DialogResult res = MessageBox.Show(this, "Are you sur to delete this row ?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (res == DialogResult.OK) { Framework.MidiDriver.ActionTable.Remove(Action.Key); dataGridView1.Rows.RemoveAt(e.RowIndex); } } else { if (OnActionListSelected != null) { OnActionListSelected(Action); } } }
void keyListCtrl1_OnActionListSelected(DmxFramework.Midi.Action.ActionList pAction) { //this.atctionListCtrl1.SetAction(pAction); this.atctionListCtrl1.Visible = true; }