예제 #1
0
파일: Main.cs 프로젝트: ricain59/fortaff
 public Main()
 {
     InitializeComponent();
     labelVersion.Text = "v" + version.ToString().Replace(',', '.');
     //como mudei os sound elimino onde estava o original inicialmente
     new Utils().deleteSound();
     new Utils().changeFileConfig();
     new Utils().deletefileerrors();
     //por defeito a combobox no NO
     comboBoxBRM.SelectedIndex = 0;
     comboBoxLanguage.SelectedIndex = 0;
     comboBoxSnoozeMinute.SelectedIndex = 0;
     comboBoxTimeSession.SelectedIndex = 0;
     comboBoxUpdate.SelectedIndex = 0;
     comboBoxSnoozeMinute.Enabled = false;
     comboBoxTimeSession.Enabled = false;
     //depois disso volto ao soft caso diz que não
     loadconfig();
     //aqui vou ver se existe update ou não
     checkupdate();
     //abro no separador conf stop se já foi configurado a DB
     if (comboBoxAutoStarttab.SelectedIndex != -1)
     {
         tabControlMain.SelectedIndex = comboBoxAutoStarttab.SelectedIndex;
     }
     //o resto
     start = false;
     db.getData(textBoxUser.Text, textBoxServer.Text, textBoxPort.Text, textBoxPass.Text, textBoxDb.Text, textBoxPlayer.Text);
     textBoxPlayer.Enabled = false;
     if (!textBoxServer.Text.Equals(""))
     {
         textBoxPlayer.Enabled = true;
         fillTextboxPlayer();
     }
     if (checkBoxAutoStartWarmup.Checked)
     {
         DataTable dt = dbsqlite.GetDataTable("select * from questionwc where enabled = 1 AND type != 'cooldown'");
         if (dt.Rows.Count > 0)
         {
             fw = new FormWarmup(dbsqlite);
             fw.Show();
         }
         else
         {
             MessageBox.Show("You haven't configure warmup");
         }
     }
     //brm management
     checkBrm();
     //autostart
     if (checkBoxAutoStart.Checked)
     {
         autoStart();
         this.WindowState = FormWindowState.Minimized;
         this.ShowInTaskbar = false;
         //this.Visible = false;
     }
 }
예제 #2
0
파일: Main.cs 프로젝트: ricain59/fortaff
 /// <summary>
 /// start manually warmup
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void buttonStartWarmup_Click(object sender, EventArgs e)
 {
     DataTable dt = dbsqlite.GetDataTable("select * from questionwc where enabled = 1 AND type != 'cooldown'");
     if (dt.Rows.Count > 0)
     {
         fw = new FormWarmup(dbsqlite);
         fw.Show();
     }
     else
     {
         MessageBox.Show("You haven't configure warmup");
     }
 }