private void LoadProducts(string dataSource) { List <AbstractExchange> cExchanges = ProductManager.Manager.Exchanges; int iCount = cExchanges.Count; if (iCount > 0) { for (int i = 0; i < iCount; i++) { AbstractExchange cExchange = cExchanges[i]; int iIndex = 0; string sExchangeName = cExchange.ShortName; ESymbolCategory[] cCategorys = Enum.GetValues(typeof(ESymbolCategory)) as ESymbolCategory[]; foreach (ESymbolCategory cCategory in cCategorys) { List <string> cSymbols = cExchange.GetProductClassify(cCategory); if (cSymbols != null && cSymbols.Count > 0) { ++iIndex; tabControl_Products.TabPages.Add(cCategory.ToString()); if (iIndex == __cSources.Count) { SimpleBoundList <_ProductInfo> cList = new SimpleBoundList <_ProductInfo>(cSymbols.Count); cList.AllowSort = true; cList.SetComparers(__cComparison); __cSources.Add(cList); } foreach (string sSymbolId in cSymbols) { AbstractProductProperty cProperty = cExchange.GetProperty(sSymbolId, dataSource); if (cProperty != null) { _ProductInfo cProductInfo = new _ProductInfo() { ProductId = sSymbolId, Description = cProperty.Description, ExchangeName = sExchangeName }; __cSources[0].Add(cProductInfo); __cSources[iIndex].Add(cProductInfo); } } } } } } }