Example #1
0
        void CommandChosen(CommandData cmd, ParamiterType paramiterOptions)
        {
            if(textBox1.Text == "")
            {
                MessageBox.Show("Enter a flag");
                return;
            }

            if (paramiterOptions != ParamiterType.NoParamiters)
            {
                if(textBox1.Text.Contains(' '))
                {
                    MessageBox.Show("This command does not support spaces in the flag.");
                    return;
                }
                if(flagIsregex.Checked)
                {
                    MessageBox.Show("This command does not support regex flags.");
                    return;
                }
            }

            if (flagIsregex.Checked)
            {
                try
                {
                    Regex.Match("testRegex", textBox1.Text);
                }
                catch
                {
                    MessageBox.Show("Regex is invalid.");
                    return;
                }
            }
            _data = new TBotCommand(cmd, textBox1.Text);
            _data.FlagIsRegex = flagIsregex.Checked;
            _data.FlagCaseSensitive = flagCasesensitive.Checked;
            _data.RequiresModerator = modOnly.Checked;
            _data.Paramiters = paramiterOptions;
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }
Example #2
0
 public TBotCommand(CommandData cd, string flag)
 {
     _data = cd;
     _flag = flag;
 }