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