public bool SetExchange(ExchangeManager.Exchange exchange) { if (InvokeRequired) { SetExchangeCallback d = new SetExchangeCallback(SetExchange); Invoke(d, new object[] { exchange }); } else { Exchange = exchange; toolStripLabel_symbol.Text = Exchange.CurrentTicker.symbol; toolStripLabel_symbol.Image = ContentManager.GetSymbolIcon(Exchange.CurrentTicker.symbol); toolStripLabel_market.Text = Exchange.CurrentTicker.market; toolStripLabel_market.Image = ContentManager.GetSymbolIcon(Exchange.CurrentTicker.market); cryptoCompare.setAdvancedChart(Exchange.CurrentTicker.symbol, "USD,BTC"); if (Exchange.TradingView.Length > 0) { Exchange.AdvancedChartParameters.exchange = (TradingViewCryptoExchange)Enum.Parse(typeof(TradingViewCryptoExchange), Exchange.TradingView); Exchange.AdvancedChartParameters.symbol = Exchange.CurrentTicker.symbol; Exchange.AdvancedChartParameters.market = Exchange.CurrentTicker.market; toolStripRadioButton_TradingView.Visible = true; } else { toolStripRadioButton_TradingView.Visible = false; } SetChartIndex(Exchange.ChartIndex); } return(true); }
public bool SetExchange(ExchangeManager.Exchange exchange) { if (InvokeRequired) { SetExchangeCallback d = new SetExchangeCallback(SetExchange); Invoke(d, new object[] { exchange }); } else { Exchange = exchange; //ExchangeName = exchange; ordersListControl_open.OpenOrders = true; ordersListControl_closed.OpenOrders = false; transactionsListControl_deposits.type = ExchangeManager.ExchangeTransactionType.deposit; transactionsListControl_withdraw.type = ExchangeManager.ExchangeTransactionType.withdrawal; ordersListControl_open.SetExchange(Exchange); ordersListControl_closed.SetExchange(Exchange); transactionsListControl_deposits.SetExchange(Exchange); transactionsListControl_withdraw.SetExchange(Exchange); symbolHistoryListControl.SetExchange(Exchange); createOrderControl_buy.SetExchange(Exchange); createOrderControl_sell.SetExchange(Exchange); createOrderControl_stop.SetExchange(Exchange); toolStripRadioButton_symbol.Checked = true; tabControl.SelectedIndex = 4; UpdateUI(true); } return(true); }
public bool SetExchange(ExchangeManager.Exchange exchange) { if (InvokeRequired) { SetExchangeCallback d = new SetExchangeCallback(SetExchange); Invoke(d, new object[] { exchange }); } else { Visible = false; Exchange = exchange; List <ExchangeTicker> list = Tickers.Where(item => item.exchange == Exchange.Name).ToList(); //LogManager.AddDebugMessage(this.Name, "ExchangeTickerListControl_Load", "list count=" + list.Count + " | " + exchange); var markets = list.Select(p => p.market).OrderByDescending(m => m).Distinct(); // CLEAR MARKET BUTTONS foreach (ToolStripItem item in toolStrip.Items) { if (item.Alignment == ToolStripItemAlignment.Right) { toolStrip.Items.Remove(item); } } // REBUILD BUTTONS foreach (string market in markets) { ToolStripRadioButton button = new ToolStripRadioButton() { Text = market, RadioButtonGroupId = 1, Alignment = ToolStripItemAlignment.Right, Image = ContentManager.GetSymbolIcon(market), Checked = IsMarketButton(market) }; button.Click += new EventHandler(marketButton_Click); toolStrip.Items.Add(button); toolStrip.Items.Add(new ToolStripSeparator() { Alignment = ToolStripItemAlignment.Right }); } ToolStripRadioButton allButton = new ToolStripRadioButton() { Text = "ALL", RadioButtonGroupId = 1, Image = Properties.Resources.ConnectionStatus_ACTIVE, Checked = IsMarketButton("ALL"), Alignment = ToolStripItemAlignment.Right }; allButton.Click += new EventHandler(marketButton_Click); toolStrip.Items.Add(allButton); Visible = true; UpdateUI(true); } return(true); }
public bool SetExchange(ExchangeManager.Exchange exchange) { if (InvokeRequired) { SetExchangeCallback d = new SetExchangeCallback(SetExchange); Invoke(d, new object[] { exchange }); } else { Exchange = exchange; UpdateUI(true); } return(true); }
public bool SetExchange(string exchange) { if (InvokeRequired) { SetExchangeCallback d = new SetExchangeCallback(SetExchange); Invoke(d, new object[] { }); } else { Exchange = ExchangeManager.getExchange(exchange); balanceListControl.SetExchange(Exchange); tickerListControl.SetExchange(Exchange); historyTabControl.SetExchange(Exchange); exchangeChartsControl.SetExchange(Exchange); UpdateUI(true); } return(true); }