Esempio n. 1
0
        /// <summary>
        /// Opens the TextCommandDialog to add a new command
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonTextCommandAdd_Click(object sender, EventArgs e)
        {
            using (TextCommandDialog tcd = new TextCommandDialog())
            {
                tcd.ShowDialog();
                if (tcd.DialogResult == DialogResult.OK)
                {
                    TextCommand tc = tcd.Result;
                    BotFile.AddCommand(tc);
                    RefreshCommands();

                    SaveMaoubotConfig();
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Opens the TextCommandDialog to edit the current command
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonTextCommandEdit_Click(object sender, EventArgs e)
        {
            if (comboBoxTextCommands.SelectedIndex == -1)
            {
                RefreshCommands();
                return;
            }

            using (TextCommandDialog tcd = new TextCommandDialog(BotFile.TextCommands[comboBoxTextCommands.SelectedIndex]))
            {
                tcd.ShowDialog();
                if (tcd.DialogResult == DialogResult.OK)
                {
                    TextCommand tc = tcd.Result;
                    BotFile.UpdateCommand(tc);
                    //RefreshCommands();

                    SaveMaoubotConfig();
                }
            }
        }