Пример #1
0
        private void OnActionComplete(Actions.MyActions action, dynamic optional = null)
        {
            /*
             * Modify the Form after the Action is Completed.
             * Use myAction to determine what action occurred.
             * Use Optional for additional information sent from Actions.
             */

            if (action == Actions.MyActions.Copy)
            {
                GenericMenuFunctions.CopyFromListToCombo(comboBox1, label2);
            }
            else if (action == Actions.MyActions.Paste)
            {
                label3.Text = "Last Paste: " + (string)optional;
                try
                {
                    comboBox1.SelectedIndex++;
                }
                catch
                {
                    // Ignore
                }

                Program.MyIndex = comboBox1.SelectedIndex;
                if (Program.EndOfListPasted)
                {
                    label2.Text = "End/" + comboBox1.Items.Count;
                }
            }
            else if (action == Actions.MyActions.Esc)
            {
                Actions.DblClick();
            }
        }
Пример #2
0
        private void OnActionComplete(Actions.MyActions action, dynamic optional = null)
        {
            /*
             * Modify the Form after the Action is Completed.
             * Use myAction to determine what action occurred.
             * Use Optional for additional information sent from Actions.
             */

            if (action == Actions.MyActions.Copy)
            {
                GenericMenuFunctions.CopyFromListToCombo(comboBox1, label2);
            }
            else if (action == Actions.MyActions.Paste)
            {
                label3.Text = "Last Paste: " + (string)optional;
                try
                {
                    comboBox1.SelectedIndex++;
                }
                catch
                {
                    // Ignore
                }

                Program.MyIndex = comboBox1.SelectedIndex;
                if (Program.EndOfListPasted)
                {
                    label2.Text = "End/" + comboBox1.Items.Count;
                }
            }
            else if (action == Actions.MyActions.Run)
            {
                string s = "";
                if ((string)optional == "F4")
                {
                    s = textBox1.Text;
                }
                if ((string)optional == "F5")
                {
                    s = textBox2.Text;
                }
                if ((string)optional == "F6")
                {
                    s = textBox3.Text;
                }
                if ((string)optional == "F7")
                {
                    s = textBox4.Text;
                }
                if ((string)optional == "F8")
                {
                    s = textBox5.Text;
                }

                string[] a = null;
                if (s.Contains('"'))
                {
                    string args = s.Split('"')[1];
                    s = s.Replace($"\"{args}\"", "").Trim();
                    a = args.Split(',').Select(x => x.Trim()).ToArray();
                }

                Actions.RunProcess(s, a);
            }
            else if (action == Actions.MyActions.Esc)
            {
                Actions.DblClick();
            }
        }
Пример #3
0
        private void OnActionComplete(Actions.MyActions action, dynamic optional = null)
        {
            /*
             * Modify the Form after the Action is Completed.
             * Use myAction to determine what action occurred.
             * Use Optional for additional information sent from Actions.
             */

            if (action == Actions.MyActions.Paste2)
            {
                string key = (string)optional;
                if (key == "F1")
                {
                    Actions.PasteString(textBox1.Text);
                }
                else if (key == "F2")
                {
                    Actions.PasteString(textBox2.Text);
                }
                else if (key == "F3")
                {
                    Actions.PasteString(textBox3.Text);
                }
                else if (key == "F4")
                {
                    Actions.PasteString(textBox4.Text);
                }
                else if (key == "F5")
                {
                    Actions.PasteString(textBox5.Text);
                }
                else if (key == "F6")
                {
                    Actions.PasteString(textBox6.Text);
                }
                else if (key == "F7")
                {
                    Actions.PasteString(textBox7.Text);
                }
                else if (key == "F8")
                {
                    Actions.PasteString(textBox8.Text);
                }
                else if (key == "F9")
                {
                    Actions.PasteString(textBox9.Text);
                }
                else if (key == "F10")
                {
                    Actions.PasteString(textBox10.Text);
                }
                else if (key == "F11")
                {
                    Actions.PasteString(textBox11.Text);
                }
                else if (key == "F12" || key == "{Shift}F12" || key == "{CTRL}F12" || key == "{ALT}F12")
                {
                    Actions.PasteString(textBox12.Text);
                }
            }
            else if (action == Actions.MyActions.Esc)
            {
                Actions.DblClick();
            }
        }