Beispiel #1
0
 private void btnDone_Click(object sender, EventArgs e)
 {
     try
     {
         // Ignore blank box
         if (tbValue.Text != "")
         {
             // Split item into value and currency
             string   s  = cbChannels.Items[cbChannels.SelectedIndex].ToString();
             string[] ss = s.Split(' ');
             int      n  = (int)(float.Parse(ss[0]) * 100f);
             // first set the level to 0, otherwise it just adds to level
             m_Hopper.SetCoinLevelsByCoin(n, ss[1].ToCharArray(), 0);
             // now set to value
             m_Hopper.SetCoinLevelsByCoin(n, ss[1].ToCharArray(), Int16.Parse(tbValue.Text));
         }
         else
         {
             MessageBox.Show("No input, channel values unaltered", "WARNING");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString(), "EXCEPTION");
         return;
     }
     m_Hopper.UpdateData();
     this.Close();
 }