Esempio n. 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();
            }
        }
Esempio n. 2
0
 private void UseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.UseToolStripMenuItem(sender);
 }
Esempio n. 3
0
 private void UseEscToDblClickToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.UseEscToDblClickToolStripMenuItem(sender, HotkeyComm, label1);
 }
Esempio n. 4
0
 private void TrimWhitespaceToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.TrimWhitespaceToolStripMenuItem(sender, comboBox1, label2);
 }
Esempio n. 5
0
 private void SortListToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.SortListToolStripMenuItem(sender, comboBox1, label2);
 }
Esempio n. 6
0
 private void SaveToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.SaveToolStripMenu(this);
 }
Esempio n. 7
0
 private void RemoveItemToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.RemoveItemToolStripMenuItem(comboBox1, label2);
 }
Esempio n. 8
0
 private void PauseToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.PauseToolStripMenuItem(sender, HotkeyComm);
 }
Esempio n. 9
0
 private void NewToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.NewToolStripMenuItem(this, comboBox1, label2, label3);
 }
Esempio n. 10
0
 private void ModeToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.ModeToolStripMenuItem(sender, this);
 }
Esempio n. 11
0
 private void DisableHotkeyErrorsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.DisableHotkeyErrorsToolStripMenuItem(sender);
 }
Esempio n. 12
0
 private void AboutToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     GenericMenuFunctions.AboutToolStripMenuItem();
 }
Esempio n. 13
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();
            }
        }