private void SetFullView() { tabPage_full.Controls.Clear(); TradingViewWidgetControl widget = new TradingViewWidgetControl() { Dock = DockStyle.Fill }; toolStripRadioButton_full.Image = ContentManager.GetSymbolIcon(PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol); toolStripRadioButton_full.Text = PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol.ToUpper(); PreferenceManager.TradingViewPreferences.AdvancedChartParameters.WatchList = GetWatchListBySymbol(PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol); PreferenceManager.UpdatePreferenceFile(PreferenceManager.PreferenceType.TradingView); widget.setAdvancedChart(PreferenceManager.TradingViewPreferences.AdvancedChartParameters); tabPage_full.Controls.Add(widget); //LogManager.AddLogMessage(Name, "SetFullView", Size.Width + " | " + Size.Height + " || " + tabControl.Width + " | " + tabControl.Height + " || " + widget.Width + " | " + widget.Height + " || " + ParentForm.Width + " | " + ParentForm.Height + " || " + ParentForm.ClientSize.Width + " | " + ParentForm.ClientSize.Height, LogManager.LogMessageType.DEBUG); SetBTCView(); SetUSDView(); }
private void SetUSDView() { // USD tabPage_usd.Controls.Clear(); TableLayoutPanel table = new TableLayoutPanel() { Dock = DockStyle.Fill }; int columnCount = GetTableCount("column", exchanges.Count); int rowCount = GetTableCount("row", exchanges.Count); table.ColumnCount = columnCount; table.RowCount = rowCount; for (int i = 0; i < columnCount + 1; i++) { table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); } for (int i = 0; i < rowCount + 1; i++) { table.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); } int currentColumn = 0; int currentRow = 0; foreach (ExchangeManager.Exchange exchange in exchanges) { // make a widget TradingViewWidgetControl chartWidget = new TradingViewWidgetControl() { Dock = DockStyle.Fill }; TradingViewAdvancedChartParameters parameters = new TradingViewAdvancedChartParameters() { symbol = PreferenceManager.TradingViewPreferences.AdvancedChartParameters.symbol, market = exchange.USDSymbol, exchange = (TradingViewCryptoExchange)Enum.Parse(typeof(TradingViewCryptoExchange), exchange.TradingView, true), hide_top_toolbar = true, withdateranges = true, theme = PreferenceManager.TradingViewPreferences.AdvancedChartParameters.theme }; chartWidget.setAdvancedChart(parameters); //chartWidget.SetPair(exchange.Symbol, symbol, exchange.USDSymbol); table.Controls.Add(chartWidget, currentColumn, currentRow); if (currentColumn < columnCount) { // increment column currentColumn++; } else { // reset column increment row currentColumn = 0; currentRow++; } } tabPage_usd.Controls.Add(table); }
private void SetCustomView() { tabPage_custom.Controls.Clear(); TableLayoutPanel table = new TableLayoutPanel() { Dock = DockStyle.Fill }; //int columnCount = GetTableCount("column", PreferenceManager.TradingViewPreferences.WatchList.Count); //int rowCount = GetTableCount("row", PreferenceManager.TradingViewPreferences.WatchList.Count); //int columnCount = GetTableCount("column", PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.Count); //int rowCount = GetTableCount("row", PreferenceManager.TradingViewPreferences.SymbolOverviewParameters.symbols.Count); List <TradingViewSymbolOverview> list = PreferenceManager.TradingViewPreferences.GetCurrentWatchList(); int columnCount = GetTableCount("column", list.Count); int rowCount = GetTableCount("row", list.Count); table.ColumnCount = columnCount; table.RowCount = rowCount; for (int i = 0; i < columnCount + 1; i++) { table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); } for (int i = 0; i < rowCount + 1; i++) { table.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); } int currentColumn = 0; int currentRow = 0; foreach (TradingViewSymbolOverview item in list) { TradingViewWidgetControl chartWidget = new TradingViewWidgetControl() { Dock = DockStyle.Fill }; TradingViewAdvancedChartParameters parameters = new TradingViewAdvancedChartParameters() { symbol = item.symbol, market = item.market, //exchange = (TradingViewCryptoExchange)Enum.Parse(typeof(TradingViewCryptoExchange), item.exchange.ToString(), true), exchange = item.exchange, withdateranges = true //hide_top_toolbar = true }; chartWidget.setAdvancedChart(parameters); table.Controls.Add(chartWidget, currentColumn, currentRow); if (currentColumn < columnCount) { currentColumn++; } else { currentColumn = 0; currentRow++; } } tabPage_custom.Controls.Add(table); }