Ejemplo n.º 1
0
 private void UpdateChecker_Timer_Tick(object sender, EventArgs e)
 {
     try
     {
         string   last_index  = ctrl.read_index();
         T_result new_massage = ctrl.get_update(last_index);
         BotStart_Botton.BackColor = Color.Green;
         BotStart_Botton.Text      = "متصل شد ";
         if (new_massage.result.Count > 0)
         {
             Bot_Log(new_massage);
             ctrl.responce(new_massage);
             ctrl.save_index(ctrl.get_update());
         }
     }
     catch (Exception ex)
     {
         UpdateChecker_Timer.Stop();
         ReStartBot_timer.Start();
         BotStart_Botton.BackColor = Color.Orange;
         BotStart_Botton.Enabled   = true;
         BotStart_Botton.Text      = "عدم اتصال";
         warning_log(ex.Message);
     }
 }
Ejemplo n.º 2
0
 private void BotStart_Botton_Click(object sender, EventArgs e)
 {
     UpdateChecker_Timer.Start();
     ResetTimer();
     BotStart_Botton.BackColor = Color.Olive;
     BotStart_Botton.Text      = " ... در حال اتصال";
     BotStart_Botton.Enabled   = false;
 }
Ejemplo n.º 3
0
 private void BotStop_Botton_Click(object sender, EventArgs e)
 {
     UpdateChecker_Timer.Stop();
     ReStartBot_timer.Stop();
     BotStart_Botton.BackColor = Color.Orange;
     BotStart_Botton.Text      = "اتصال ";
     BotStart_Botton.Enabled   = true;
 }