Exemplo n.º 1
0
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
            {
                return;
            }

            DmxFramework.Keyboard.Hotkey key    = (DmxFramework.Keyboard.Hotkey) this.dataGridView1.Rows[e.RowIndex].Tag;
            DmxFramework.Keyboard.Action action = (DmxFramework.Keyboard.Action) this.dataGridView1.Rows[e.RowIndex].Cells[2].Tag;
            if (e.ColumnIndex == 4)
            {
                key.Actions.Remove(action);

                /*if (key.Actions.Count == 0)
                 * {
                 *  Main.mFrameWork.KeyBord.Remove(key);
                 *  this.comboKey.rem
                 * }*/
                RefreshKeyTable((Hotkey)this.comboKey.SelectedItem);
            }
            else if (e.ColumnIndex == 3)
            {
                action.StopOnKeyUp = !(action.StopOnKeyUp);
                RefreshKeyTable((Hotkey)this.comboKey.SelectedItem);
            }
        }
Exemplo n.º 2
0
        private void RefreshKeyTable(DmxFramework.Keyboard.Hotkey pKey)
        {
            this.dataGridView1.Rows.Clear();

            if (pKey == null)
            {
                return;
            }
            try
            {
                foreach (DmxFramework.Keyboard.Action action in pKey.Actions)
                {
                    int index = this.dataGridView1.Rows.Add();
                    this.dataGridView1.Rows[index].Tag            = pKey;
                    this.dataGridView1.Rows[index].Cells[0].Value = pKey.KeyCode;
                    this.dataGridView1.Rows[index].Cells[1].Value = pKey.KeyValue;
                    this.dataGridView1.Rows[index].Cells[2].Value = action.Path;
                    this.dataGridView1.Rows[index].Cells[2].Tag   = action;
                    ((DataGridViewCheckBoxCell)this.dataGridView1.Rows[index].Cells[3]).Value = action.StopOnKeyUp;
                    this.dataGridView1.Rows[index].Cells[4].Value = "Remove";
                }
            }
            catch { }
        }
Exemplo n.º 3
0
 public void Remove(Hotkey pKey)
 {
     mHashTable.Remove(pKey.KeyValue);
     mKeyList.Remove(pKey);
 }