Esempio n. 1
0
 public FormSet(Stoploss formsl, Double loss, Int64 hand, Int32 time, Double win, Double losspeak, Double peakover, Boolean hidebb, Double wininter, Double lossinter)
 {
     InitializeComponent();
     sl = formsl;
     textBoxStopHand.Text = hand.ToString();
     textBoxStopLoss.Text = loss.ToString();
     textBoxStopTime.Text = time.ToString();
     textBoxStopWin.Text = win.ToString();
     textBoxStopLossPeak.Text = losspeak.ToString();
     textBoxPeakOver.Text = peakover.ToString();
     textBoxStopLossIntermediate.Text = lossinter.ToString();
     textBoxStopWinIntermediate.Text = wininter.ToString();
     if (hidebb)
     {
         checkBoxHideBbbs.Checked = true;
     }
     else
     {
         checkBoxHideBbbs.Checked = false;
     }
     loadconfig();
 }
Esempio n. 2
0
        /// <summary>
        /// Method qui start the stop and others
        /// </summary>
        private void autoStart()
        {
            Boolean stop = verifyErrorBeforeStart();
            //fechar o skype
            if (checkBoxCloseSkype.Checked)
            {
                new Utils().detectApps("Skype");
            }

            //aqui recolho os dados todos para o para a janela do stoploss
            try
            {
                if (!stop)
                {
                    int stoplosspeak = new Utils().stringtoInt32(textBoxStopLossPeak.Text);
                    int overpeak = new Utils().stringtoInt32(textBoxPeakOver.Text);
                    if (textBoxPlayer.Text.Equals("") || (stoplosspeak > 0 && overpeak == 0))
                    {
                        if (textBoxPlayer.Text.Equals(""))
                        {
                            MessageBox.Show("Fill player name please.");
                            tabControlMain.SelectedIndex = 0;
                        }
                        else
                        {
                            MessageBox.Show("Fill peak over please.");
                            tabControlMain.SelectedIndex = 1;
                        }
                    }
                    else
                    {
                        this.Visible = false;
                        Stoploss sl;
                        List<Tuple<String, String>> playeralias;
                        //em vez de mandar só string crio um array do que preciso
                        //data
                        //0 - stoploss
                        //1- stophand
                        //2 - stoptime
                        //3 - stopwin
                        //4 - stoplosspeak
                        //5 - peakover
                        //6 - lossintermediate
                        //7 - winintermediate
                        //8 - vpp
                        //9 - rake
                        //10 - stoplossintermediatemoney
                        //11 - stoplossmoney
                        //12 - 0: eur, 1: usd
                        String[] data = { textBoxStopLoss.Text, textBoxStopHand.Text, textBoxStopTime.Text, textBoxStopWin.Text, textBoxStopLossPeak.Text, textBoxPeakOver.Text, textBoxStopLossIntermediate.Text, textBoxStopWinIntermediate.Text, textBoxStopVPP.Text, textBoxStopRake.Text, textBoxStopLossIntermediateMoney.Text, textBoxStopLossMoney.Text };
                        String[] sounds = { soundloss, soundtime, soundwin, soundhands, soundinternediateloss, soundinternediatewin };
                        //check
                        //0 - hidebb
                        //1 - button set
                        //2 - verify app
                        //3 - rage quit
                        //4 - snooze
                        //5 - repeatwin
                        //6 - repeatloss
                        //7 - repeathand
                        //8 - repeattime
                        //9 - timerstart 1ª mão
                        //10 - always visible bb
                        //11 - viewvpp
                        //12 - ragequitSL
                        Boolean[] checkb = { checkBoxHideBbbs.Checked, checkBoxButtonSet.Checked, checkBoxVerifyApplication.Checked, checkBoxRageQuit.Checked, checkBoxSnoozeSound.Checked, repeatstopwin, repeatstoploss, repeatstophand, repeatstoptime, checkBoxStartTimer.Checked, checkBoxAlwaysVisible.Checked, checkBoxViewVPP.Checked, checkBoxRageQuitSL.Checked };
                        //para o limit
                        Int32 limit;
                        if (comboBoxBRM.SelectedIndex == 0)
                        {
                            limit = 0;
                        }
                        else
                        {
                            limit = new Utils().stringtoInt32(comboBoxBRM.SelectedItem.ToString());
                        }
                        Int32 minutesnooze = new Utils().stringtoInt32(comboBoxSnoozeMinute.SelectedItem.ToString());
                        //
                        if (checkBoxHem1.Checked || checkBoxHem2.Checked)
                        {
                            if (checkBoxHem1.Checked)//hem1
                            {
                                //ver se é um alias ou não
                                if (alias)
                                {
                                    playeralias = db.isAlias(textBoxPlayerID.Text);
                                }
                                else
                                {
                                    playeralias = new List<Tuple<String, String>>();
                                    playeralias.Add(Tuple.Create(textBoxPlayerID.Text, textBoxPlayer.Text));
                                    //sl = new Stoploss(this, textBoxPlayerID.Text, db, textBoxPlayer.Text, textBoxStopLoss.Text, textBoxStopHand.Text, textBoxStopTime.Text, textBoxStopWin.Text, 2);
                                }
                                sl = new Stoploss(this, playeralias, db, data, checkb, limit, minutesnooze, sounds, 1, lastbbsum, Lastidhand);
                            }
                            else //hem2
                            {
                                //ver se é um alias ou não
                                if (alias)
                                {
                                    playeralias = db.isAlias(textBoxPlayerID.Text);
                                }
                                else
                                {
                                    playeralias = new List<Tuple<String, String>>();
                                    playeralias.Add(Tuple.Create(textBoxPlayerID.Text, textBoxPlayer.Text));
                                    //sl = new Stoploss(this, textBoxPlayerID.Text, db, textBoxPlayer.Text, textBoxStopLoss.Text, textBoxStopHand.Text, textBoxStopTime.Text, textBoxStopWin.Text, 2);
                                }
                                sl = new Stoploss(this, playeralias, db, data, checkb, limit, minutesnooze, sounds, 2, lastbbsum, Lastidhand);
                            }
                        }
                        else //pt4
                        {
                            if (alias)
                            {
                                playeralias = db.isAliasPt4(textBoxPlayerID.Text);
                            }
                            else
                            {
                                playeralias = new List<Tuple<String, String>>();
                                playeralias.Add(Tuple.Create(textBoxPlayerID.Text, textBoxPlayer.Text));
                                //sl = new Stoploss(this, textBoxPlayerID.Text, db, textBoxPlayer.Text, textBoxStopLoss.Text, textBoxStopHand.Text, textBoxStopTime.Text, textBoxStopWin.Text, 2);
                            }
                            sl = new Stoploss(this, playeralias, db, data, checkb, limit, minutesnooze, sounds, 4, lastbbsum, Lastidhand);
                        }
                        sl.Show();
                    }
                }
            }
            catch (Exception ex)
            {
                new Debug().LogMessage(ex.ToString());
            }
        }