Ejemplo n.º 1
0
 private void commandsList_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if (commandList.SelectedIndices.Count > 0)
     {
         ListViewItem i  = commandList.SelectedItems[0];
         TBotCommand  cd = (TBotCommand)i.Tag;
         using (AddCommandForm acf = new AddCommandForm(cd, i.Text))
         {
             if (acf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 i.Text             = acf.Command.Flag;
                 i.Tag              = acf.Command;
                 i.SubItems[1].Text = acf.Command.Data.Type;
                 if (acf.Command.FlagIsRegex)
                 {
                     i.SubItems[1].Text += " [R]";
                 }
                 if (acf.Command.FlagCaseSensitive)
                 {
                     i.SubItems[1].Text += " [C]";
                 }
                 if (acf.Command.RequiresModerator)
                 {
                     i.Group = commandList.Groups["mod"];
                 }
                 else
                 {
                     i.Group = commandList.Groups["all"];
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void addNewCommandToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (AddCommandForm acf = new AddCommandForm())
     {
         if (acf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             if (!AddCommand(acf.Command))
             {
                 MessageBox.Show("There is alredy a command with this flag.");
             }
         }
     }
 }
Ejemplo n.º 3
0
 private void addNewCommandToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (AddCommandForm acf = new AddCommandForm())
     {
         if(acf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             if(!AddCommand(acf.Command))
                 MessageBox.Show("There is alredy a command with this flag.");
         }
     }
 }
Ejemplo n.º 4
0
 private void commandsList_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     if(commandList.SelectedIndices.Count > 0)
     {
         ListViewItem i = commandList.SelectedItems[0];
         TBotCommand cd = (TBotCommand)i.Tag;
         using(AddCommandForm acf = new AddCommandForm(cd, i.Text))
         {
             if(acf.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 i.Text = acf.Command.Flag;
                 i.Tag = acf.Command;
                 i.SubItems[1].Text = acf.Command.Data.Type;
                 if (acf.Command.FlagIsRegex)
                     i.SubItems[1].Text += " [R]";
                 if (acf.Command.FlagCaseSensitive)
                     i.SubItems[1].Text += " [C]";
                 if (acf.Command.RequiresModerator)
                     i.Group = commandList.Groups["mod"];
                 else
                     i.Group = commandList.Groups["all"];
             }
         }
     }
 }