Example #1
0
        private void mapButton_Click(object sender, EventArgs e)
        {
            if (actionTree.SelectedNode == null)
            {
                return;
            }

            IMapDialog dialog;

            if ((string)actionTree.SelectedNode.Tag == "keystroke")
            {
                dialog = new MapKeystrokeForm(MainForm, Controller);
            }
            else if ((string)actionTree.SelectedNode.Tag == "pointer")
            {
                dialog = new MapPointerForm(MainForm, Controller);
            }
            else if ((string)actionTree.SelectedNode.Tag == "mouse-button")
            {
                dialog = new MapMouseButtonForm(MainForm, Controller);
            }
            else if ((string)actionTree.SelectedNode.Tag == "mouse-wheel")
            {
                dialog = new MapMouseWheelForm(MainForm, Controller);
            }
            else if ((string)actionTree.SelectedNode.Tag == "command")
            {
                dialog = new MapCommandDialog(MainForm, Controller);
            }
            else if ((string)actionTree.SelectedNode.Tag == "open-file")
            {
                dialog = new MapOpenFileDialog(MainForm, Controller);
            }
            else
            {
                return;
            }

            if (Slot != null)
            {
                dialog.SetInput(Slot);
            }

            var form = dialog as Form;

            form.ShowDialog(this.ParentForm);
            if (form.DialogResult == DialogResult.OK)
            {
                if (Finished != null)
                {
                    Finished(this, EventArgs.Empty);
                }
            }
        }
Example #2
0
        private void mapButton_Click(object sender, EventArgs e)
        {
            if (actionTree.SelectedNode == null)
                return;

            IMapDialog dialog;

            if ((string)actionTree.SelectedNode.Tag == "keystroke")
                dialog = new MapKeystrokeForm(MainForm, Controller);
            else if ((string)actionTree.SelectedNode.Tag == "pointer")
                dialog = new MapPointerForm(MainForm, Controller);
            else if ((string)actionTree.SelectedNode.Tag == "mouse-button")
                dialog = new MapMouseButtonForm(MainForm, Controller);
            else if ((string)actionTree.SelectedNode.Tag == "mouse-wheel")
                dialog = new MapMouseWheelForm(MainForm, Controller);
            else if ((string)actionTree.SelectedNode.Tag == "command")
                dialog = new MapCommandDialog(MainForm, Controller);
            else if ((string)actionTree.SelectedNode.Tag == "open-file")
                dialog = new MapOpenFileDialog(MainForm, Controller);
            else
                return;

            if (Slot != null)
                dialog.SetInput(Slot);

            var form = dialog as Form;

            form.ShowDialog(this.ParentForm);
            if (form.DialogResult == DialogResult.OK) {
                if (Finished != null) Finished(this, EventArgs.Empty);
            }
        }