Пример #1
0
        public Home()
        {
            InitializeComponent();
            ac = new ApiConnect();

            ApiSettings saved = ac.readSettings();

            if (saved.OrganizationID != null)
            {
                ac.setup(saved);

                if (saved.Enviorment == 1)
                {
                    currency = "BTC";
                }
                ac.currency = currency;
                refreshBalance();
                refreshOrders(false);
                ac.getPools(true);

                timer = new System.Threading.Timer(
                    e => runBot(),
                    null,
                    TimeSpan.Zero,
                    TimeSpan.FromSeconds(60));
            }
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.button2.Enabled = false;
            this.label5.Visible  = false; //error
            this.label6.Visible  = false; //success

            ApiSettings current = formSettings();

            ac.setup(current);
            if (ac.settingsOk())
            {
                this.label6.Visible  = true;
                this.button2.Enabled = true;
            }
            else
            {
                this.label5.Visible = true;
            }
        }