Пример #1
0
 public void endPoll(string results)
 {
     if (poll.isRunning())
     {
         bot.sM(poll.endPoll());
         if (results != null)
         {
             this.metroTextBox22.Text = poll.getPollResults();
             poll = null;
         }
     }
 }
Пример #2
0
 private void metroButton7_Click(object sender, EventArgs e)
 {
     try
     {
         if (poll == null)
         {
             Dictionary<string, int> g = new Dictionary<string, int>();
             g.Clear();
             string[] gg = this.metroTextBox20.Text.Split(new char[] { ';' }, 10);
             foreach (string f in gg)
             {
                 if (f != "")
                     g.Add(f.ToLower(), 0);
             }
             pconf.ans = g;
             pconf.duration = Int32.Parse(this.metroTextBox21.Text);
             poll = new Poll(pconf);
             bot.sM(poll.startPoll(this.metroTextBox19.Text));
         }
     }
     catch (Exception ed)
     {
         MetroMessageBox.Show(this, "Fatal error attempting to initiate poll. Loading error debugger..", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
         MessageBox.Show(ed.ToString());
     }
 }