Example #1
0
        private void insertButton_Click(object sender, EventArgs e)
        {
            int element = macroListBox.SelectedIndex / 2;

            EditMacro    editForm = new EditMacro();
            DialogResult result   = editForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                keyBinds.ElementAt(selectedMacro).macroList.Insert(element, editForm.macro);
            }
            editForm.Close();
            refreshMacro();
        }
Example #2
0
        private void editButton_Click(object sender, EventArgs e)
        {
            int element = macroListBox.SelectedIndex / 2;

            Macro        temp     = keyBinds.ElementAt(selectedMacro).macroList.ElementAt(element);
            EditMacro    editForm = new EditMacro(temp);
            DialogResult result   = editForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                keyBinds.ElementAt(selectedMacro).macroList.ElementAt(element).theMacro        = editForm.eventType;
                keyBinds.ElementAt(selectedMacro).macroList.ElementAt(element).theMacroEvent   = (int)editForm.key;
                keyBinds.ElementAt(selectedMacro).macroList.ElementAt(element).timeBeforeEvent = editForm.time;
            }
            editForm.Close();
            refreshMacro();
        }