Exemplo n.º 1
0
        /// <summary>
        /// Clear fields and gets the fee for the selected pair
        /// </summary>
        private void OnPairChanged(PairSelected m)
        {
            if (m.SelectorType != SelectorType.Main)
            {
                return;
            }
            try
            {
                _selectedPair        = m.Pair;
                lblItem1Balance.Text = lblItem2Balance.Text = string.Empty;
                txtBuyAmount.Text    = txtBuyPrice.Text = txtSellAmount.Text = txtSellPrice.Text = string.Empty;
                var feeRes = _proxy.GetFee(m.Pair);
                lblCurrency1.Text          = lblCurrency2.Text = m.Pair.Item2;
                lblSellAmountCurrency.Text = lblBuyAmountCurrency.Text = m.Pair.Item1;

                _fee = feeRes.Success ? feeRes.Result : new Fee {
                    BuyFee = 0.5m, SellFee = 0.5m
                };
                lblBuyFee.Text   = lblSellFee.Text = "0";
                lblBuyTotal.Text = lblSellTotal.Text = "0";
                UpdateBalance(false);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                ErrorHelper.DisplayErrorMessage(ex.ToString());
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Clear fields and gets the fee for the selected pair
        /// </summary>
        private void OnPairChanged(PairSelected m)
        {
            if (m.SelectorType != SelectorType.Main)
            {
                return;
            }
            try
            {
                _selectedPair = m.Pair;
                lblItem1Balance.Text = lblItem2Balance.Text = string.Empty;
                txtBuyAmount.Text = txtBuyPrice.Text = txtSellAmount.Text = txtSellPrice.Text = string.Empty;
                var feeRes = _proxy.GetFee(m.Pair);
                lblCurrency1.Text = lblCurrency2.Text = m.Pair.Item2;
                lblSellAmountCurrency.Text = lblBuyAmountCurrency.Text = m.Pair.Item1;

                _fee = feeRes.Success ? feeRes.Result : new Fee { BuyFee = 0.5m, SellFee = 0.5m };
                lblBuyFee.Text = lblSellFee.Text = "0";
                lblBuyTotal.Text = lblSellTotal.Text = "0";
                UpdateBalance(false);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
                ErrorHelper.DisplayErrorMessage(ex.ToString());
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Called when the main screen's pair changes
 /// </summary>
 /// <param name="message"></param>
 private void OnPairSelected(PairSelected message)
 {
     if (message.SelectorType == SelectorType.Main)
     {
         _selectedPair = message.Pair;
         dgvOpenOrders.Rows.Clear();
         colAmount.HeaderText     = message.Pair.Item1 + " Amount";
         colPrice.HeaderText      = "Price in " + message.Pair.Item2;
         colTotalPrice.HeaderText = "Total Price in " + message.Pair.Item2;
         RefreshOrders(false);//Auto refresh of open orders
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Called when the main screen's pair changes
 /// </summary>
 /// <param name="message"></param>
 private void OnPairSelected(PairSelected message)
 {
     if (message.SelectorType == SelectorType.Main)
     {
         _selectedPair = message.Pair;
         dgvOpenOrders.Rows.Clear();
         colAmount.HeaderText = message.Pair.Item1 + " Amount";
         colPrice.HeaderText = "Price in " + message.Pair.Item2;
         colTotalPrice.HeaderText = "Total Price in " + message.Pair.Item2;
         RefreshOrders(false);//Auto refresh of open orders
     }
 }
Exemplo n.º 5
0
 private void PairsListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     PairSelected?.Invoke((PairVM)e.AddedItems[0]);
 }