Example #1
0
        private async void ExecConsoleCommand()
        {
            if (TCManager.Instance.Online)
            {
                await TCAction.ExecuteCommand(ConsoleCommand);
            }

            ConsoleCommand = String.Empty;
        }
Example #2
0
        private async void executeCommandButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(executeCommandTextBox.Text))
            {
                MessageBoxEx.Show(this, "You must enter a command to execute!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            try
            {
                AddMessage(String.Format("Console: {0}: ", executeCommandTextBox.Text + Environment.NewLine), Color.Chartreuse);

                await TCAction.ExecuteCommand(executeCommandTextBox.Text);

                executeCommandTextBox.Text = String.Empty;
            }
            catch (Exception ex)
            {
                MessageBoxEx.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }