public SeriesList.SeriesInformation this[string seriesName] { [MethodImpl(MethodImplOptions.NoInlining)] get { SeriesList.SeriesInformation result; try { if (this.itemsKeySymbol.ContainsKey(seriesName)) { result = this[this.itemsKeySymbol[seriesName]]; } else { result = new SeriesList.SeriesInformation { Symbol = string.Empty }; } } catch (Exception ex) { throw ex; } return result; } }
private void ViewOddLotSetNewStock(string stockSymbol, bool isForce) { try { if (stockSymbol != string.Empty && (this._stockInfoSET == null || isForce || (this._stockInfoSET != null && stockSymbol != this._stockInfoSET.Symbol))) { StockList.StockInformation stockInformation = ApplicationInfo.StockInfo[stockSymbol + "_ODD"]; if (stockInformation.Number > 0) { this._seriesInfoTFEX = null; this._stockInfoSET = stockInformation; ApplicationInfo.CurrentSymbol = stockSymbol; this.ViewOddLotReloadData(); } else { this._stockInfoSET = null; this._seriesInfoTFEX = null; this.intzaLS.ClearAllText(); this.intzaViewOddLot.ClearAllText(); this.intzaViewOddLotInfo.ClearAllText(); this.intzaLS.Redraw(); this.intzaViewOddLot.Redraw(); this.intzaViewOddLotInfo.Redraw(); } } if (this.tscbStock.Text != ApplicationInfo.CurrentSymbol) { this.tscbStock.Text = ApplicationInfo.CurrentSymbol; } this.tscbStock.Focus(); this.tscbStock.SelectAll(); } catch (Exception ex) { this.ShowError("ViewOddLotSetNewStock", ex); } }
private void StockInPlay_SetNewStock(string symbol, bool isForce) { try { if (symbol != string.Empty && (isForce || symbol != this._currentSymbol)) { StockList.StockInformation stockInformation = ApplicationInfo.StockInfo[symbol]; if (stockInformation.Number > 0) { this._stockInfoSET = stockInformation; this._seriesInfoTFEX = null; this.intzaInfo.Visible = true; this.intzaInfoTFEX.Visible = false; ApplicationInfo.CurrentSymbol = this._stockInfoSET.Symbol; this._currentSymbol = this._stockInfoSET.Symbol; this.StockInPlayReloadData(0m, "", this._stockInfoSET.Number); } else { SeriesList.SeriesInformation seriesInformation = ApplicationInfo.SeriesInfo[symbol]; if (seriesInformation.Symbol != string.Empty) { this._isNewStock = true; this._currentSymbol = seriesInformation.Symbol; this._seriesInfoTFEX = seriesInformation; this._stockInfoSET = null; this.intzaInfoTFEX.Visible = true; this.intzaInfo.Visible = false; ApplicationInfo.CurrentSymbol = seriesInformation.Symbol; this.StockInPlayReloadData_TFEX(seriesInformation.Symbol, seriesInformation.SeriesType, seriesInformation.TickSize, 0m, ""); } } } if (this.tscbStock.Text != ApplicationInfo.CurrentSymbol) { this.tscbStock.Text = ApplicationInfo.CurrentSymbol; } this.tscbStock.Focus(); this.tscbStock.SelectAll(); } catch (Exception ex) { this.ShowError("StockInPlaySetNewStock", ex); } }
private void SaleByTime_SetNewStock(string stockSymbol, bool isForce) { try { if (stockSymbol != string.Empty) { if (stockSymbol != string.Empty && (this._stockInfoSET == null || isForce || (this._stockInfoSET != null && stockSymbol != this._stockInfoSET.Symbol))) { StockList.StockInformation stockInformation = ApplicationInfo.StockInfo[stockSymbol]; if (stockInformation.Number > 0) { this._seriesInfoTFEX = null; this._stockInfoSET = stockInformation; this.intzaInfo.Visible = true; this.intzaInfoTFEX.Visible = false; ApplicationInfo.CurrentSymbol = this._stockInfoSET.Symbol; this._saleByTimePageNo = 1; this.SaleByTimeReloadData(); } else { SeriesList.SeriesInformation seriesInformation = ApplicationInfo.SeriesInfo[stockSymbol]; if (seriesInformation != null && seriesInformation.Symbol != string.Empty) { this._stockInfoSET = null; this._seriesInfoTFEX = seriesInformation; this.intzaInfoTFEX.Visible = true; this.intzaInfo.Visible = false; ApplicationInfo.CurrentSymbol = this._seriesInfoTFEX.Symbol; this._saleByTimePageNo = 1; this.SaleByTimeReloadData(); } } } } if (this.tscbStock.Text != ApplicationInfo.CurrentSymbol) { this.tscbStock.Text = ApplicationInfo.CurrentSymbol; } this.tscbStock.Focus(); this.tscbStock.SelectAll(); } catch (Exception ex) { this.ShowError("SaleByTimeSetNewStock", ex); } }
private void OnDataIn(string message) { if (!string.IsNullOrEmpty(message)) { try { this._lastEcho = DateTime.Now; if (!(message == "ER")) { if (message.Substring(0, 1) == "E") { IBroadcastMessage broadcastMessage = this._bcMessageFactory.CreateSETMessage(message.Substring(1)); if (broadcastMessage != null) { StockList.StockInformation stockInformation = null; string messageType = broadcastMessage.MessageType; switch (messageType) { case "L+": { LSAccumulate lSAccumulate = (LSAccumulate)broadcastMessage; stockInformation = ApplicationInfo.StockInfo[lSAccumulate.SecurityNumber]; if (stockInformation.Number <= 0) { return; } stockInformation.LastSalePrice = lSAccumulate.LastPrice; if (lSAccumulate.LastPrice > stockInformation.HighPrice) { stockInformation.HighPrice = lSAccumulate.LastPrice; } if (stockInformation.LowPrice == 0m || lSAccumulate.LastPrice < stockInformation.LowPrice) { stockInformation.LowPrice = lSAccumulate.LastPrice; } break; } case "TP": { TPMessage tPMessage = (TPMessage)broadcastMessage; stockInformation = ApplicationInfo.StockInfo[tPMessage.SecurityNumber]; if (stockInformation.Number <= 0) { return; } if (tPMessage.Side == "B") { stockInformation.BidPrice1 = tPMessage.Price1.ToString(); } else if (tPMessage.Side == "S") { stockInformation.OfferPrice1 = tPMessage.Price1.ToString(); } break; } case "PD": stockInformation = ApplicationInfo.StockInfo[((PDMessage)broadcastMessage).SecurityNumber]; break; case "SC": { SCMessage sCMessage = (SCMessage)broadcastMessage; ApplicationInfo.MarketState = sCMessage.MarketState; ApplicationInfo.MarketSession = sCMessage.MarketSession; this.SETBox.Invalidate(); break; } case "MT": { MarketInfo marketInfo = (MarketInfo)broadcastMessage; ApplicationInfo.MarketState = marketInfo.MarketState; ApplicationInfo.MarketSession = marketInfo.MarketSession; ApplicationInfo.MarketTime = marketInfo.TimeStamp; break; } case "PO": stockInformation = ApplicationInfo.StockInfo[((POMessage)broadcastMessage).SecurityNumber]; break; case "SS": { SSMessage sSMessage = (SSMessage)broadcastMessage; stockInformation = ApplicationInfo.StockInfo[sSMessage.SecurityNumber]; if (stockInformation.Number > -1) { stockInformation.PriorPrice = sSMessage.PriorPrice; stockInformation.BoardLot = sSMessage.BoardLot; stockInformation.Ceiling = sSMessage.Ceiling; stockInformation.Floor = sSMessage.Floor; stockInformation.MarketId = sSMessage.MarketId; stockInformation.SecurityType = sSMessage.SecurityType; stockInformation.SectorNumber = sSMessage.SectorNumber; stockInformation.DisplayFlag = sSMessage.DisplayFlag; } break; } case "IS": { ISMessage iSMessage = (ISMessage)broadcastMessage; IndexStat.IndexItem indexItem = ApplicationInfo.IndexStatInfo[iSMessage.Symbol]; indexItem.IndexHigh = iSMessage.IndexHigh; indexItem.IndexLow = iSMessage.IndexLow; indexItem.LastIndex = iSMessage.IndexValue; indexItem.AccValue = iSMessage.TotalValuesTraded; if (iSMessage.Symbol == ".SET") { this.SETBox.Invalidate(); } else if (iSMessage.Symbol == "." + this.SET2Box.DisplaySET) { this.SET2Box.Invalidate(); } break; } case "IE": { IEMessage iEMessage = (IEMessage)broadcastMessage; IndexStat.IndexItem indexItem = ApplicationInfo.IndexStatInfo[iEMessage.Symbol]; if (indexItem != null) { indexItem.IndexHigh = iEMessage.IndexHigh; indexItem.IndexLow = iEMessage.IndexLow; indexItem.LastIndex = iEMessage.IndexValue; indexItem.AccValue = iEMessage.AccValue; } break; } case "OL": stockInformation = ApplicationInfo.StockInfo[((OLMessage)broadcastMessage).SecurityNumber]; break; case "LO": stockInformation = ApplicationInfo.StockInfo[((LOMessage)broadcastMessage).SecurityNumber]; break; case "CO": stockInformation = ApplicationInfo.StockInfo[((COMessage)broadcastMessage).SecurityNumber]; break; } if (frmMain._OnMessageReceived != null) { frmMain._OnMessageReceived(broadcastMessage, stockInformation); } } } else if (message.Substring(0, 1) == "T") { IBroadcastMessage broadcastMessage = this._bcMessageFactory.CreateTfexMessage(message.Substring(1)); if (broadcastMessage != null) { SeriesList.SeriesInformation seriesInformation = null; string messageType = broadcastMessage.MessageType; switch (messageType) { case "TP": { TPMessageTFEX tPMessageTFEX = (TPMessageTFEX)broadcastMessage; seriesInformation = ApplicationInfo.SeriesInfo[tPMessageTFEX.OrderBookId]; if (tPMessageTFEX.Side == "B" && tPMessageTFEX.Vol1 != -1) { seriesInformation.BidPrice1 = tPMessageTFEX.Price1; } else if (tPMessageTFEX.Side == "A" && tPMessageTFEX.Vol1 != -1) { seriesInformation.OfferPrice1 = tPMessageTFEX.Price1; } break; } case "LS": { LSMessageTFEX lSMessageTFEX = (LSMessageTFEX)broadcastMessage; seriesInformation = ApplicationInfo.SeriesInfo[lSMessageTFEX.Sec]; seriesInformation.LastSalePrice = lSMessageTFEX.Price; break; } case "PO": { POMessageTFEX pOMessageTFEX = (POMessageTFEX)broadcastMessage; seriesInformation = ApplicationInfo.SeriesInfo[pOMessageTFEX.Sec]; break; } case "ST": { STMessageTFEX sTMessageTFEX = (STMessageTFEX)broadcastMessage; if (sTMessageTFEX.MarketCode == 1) { ApplicationInfo.IndexInfoTfex.TXIState = sTMessageTFEX.MarketState; ApplicationInfo.IndexInfoTfex.TXISession = sTMessageTFEX.MarketSession; } else if (sTMessageTFEX.MarketCode == 4) { ApplicationInfo.IndexInfoTfex.TXMState = sTMessageTFEX.MarketState; ApplicationInfo.IndexInfoTfex.TXMSession = sTMessageTFEX.MarketSession; } else if (sTMessageTFEX.MarketCode == 3) { ApplicationInfo.IndexInfoTfex.TXRState = sTMessageTFEX.MarketState; ApplicationInfo.IndexInfoTfex.TXRSession = sTMessageTFEX.MarketSession; } else if (sTMessageTFEX.MarketCode == 2) { ApplicationInfo.IndexInfoTfex.TXSState = sTMessageTFEX.MarketState; ApplicationInfo.IndexInfoTfex.TXSSession = sTMessageTFEX.MarketSession; } else if (sTMessageTFEX.MarketCode == 5) { ApplicationInfo.IndexInfoTfex.TXEState = sTMessageTFEX.MarketState; ApplicationInfo.IndexInfoTfex.TXESession = sTMessageTFEX.MarketSession; } else if (sTMessageTFEX.MarketCode == 6) { ApplicationInfo.IndexInfoTfex.TXCState = sTMessageTFEX.MarketState; ApplicationInfo.IndexInfoTfex.TXCSession = sTMessageTFEX.MarketSession; } break; } case "SU": { SUMessageTFEX sUMessageTFEX = (SUMessageTFEX)broadcastMessage; seriesInformation = ApplicationInfo.SeriesInfo[sUMessageTFEX.Sec]; seriesInformation.ExpireDate = sUMessageTFEX.Expdate.ToString(); seriesInformation.OpenInt = sUMessageTFEX.OpenBalance; break; } case "SD": { SDMessageTFEX sDMessageTFEX = (SDMessageTFEX)broadcastMessage; if (!ApplicationInfo.SeriesInfo.ItemsKeySymbol.ContainsKey(sDMessageTFEX.Sec.ToString())) { if (sDMessageTFEX.Group != 5) { seriesInformation = new SeriesList.SeriesInformation(); seriesInformation.Symbol = sDMessageTFEX.Sec; seriesInformation.MarketCode = sDMessageTFEX.Market; seriesInformation.Group = sDMessageTFEX.Group; seriesInformation.UnderOrderBookId = sDMessageTFEX.UnderOrderBookId; seriesInformation.ContractSize = sDMessageTFEX.Price_quot_factor; ApplicationInfo.SeriesInfo.AddItem(seriesInformation); this.UpdateAutoComplete(seriesInformation.Symbol); } } else { seriesInformation = ApplicationInfo.SeriesInfo[sDMessageTFEX.Sec]; seriesInformation.MarketCode = sDMessageTFEX.Market; seriesInformation.Group = sDMessageTFEX.Group; seriesInformation.UnderOrderBookId = sDMessageTFEX.UnderOrderBookId; seriesInformation.ContractSize = sDMessageTFEX.Price_quot_factor; } break; } case "SS": { SSMessageTFEX sSMessageTFEX = (SSMessageTFEX)broadcastMessage; seriesInformation = ApplicationInfo.SeriesInfo[sSMessageTFEX.Sec]; break; } case "BU10": { BU10MessageTFEX bU10MessageTFEX = (BU10MessageTFEX)broadcastMessage; foreach (KeyValuePair<int, SeriesList.SeriesInformation> current in ApplicationInfo.SeriesInfo.Items) { if (current.Value.Group == bU10MessageTFEX.Group && current.Value.UnderOrderBookId == bU10MessageTFEX.Commodity) { current.Value.TickSize = bU10MessageTFEX.StepSize; break; } } break; } case "IU": { IUMessageTFEX iUMessageTFEX = (IUMessageTFEX)broadcastMessage; if (iUMessageTFEX.IndxName == "SET50") { IndexStat.IndexItem indexItem2 = ApplicationInfo.IndexStatInfo[".SET50"]; if (indexItem2 != null) { if (iUMessageTFEX.LastIndx > 0m) { indexItem2.LastIndex = iUMessageTFEX.LastIndx; } } } break; } case "CA8": { CA8MessageTFEX cA8MessageTFEX = (CA8MessageTFEX)broadcastMessage; seriesInformation = ApplicationInfo.SeriesInfo[cA8MessageTFEX.Sec]; if (ApplicationInfo.IndexInfoTfex.TXISession == 2) { seriesInformation.FixPrice = cA8MessageTFEX.FixingPrice; if (seriesInformation.MarketCode == 4) { seriesInformation.PrevFixPrice = cA8MessageTFEX.FixingPrice; } } else { seriesInformation.PrevFixPrice = cA8MessageTFEX.FixingPrice; } seriesInformation.NumOfDec = cA8MessageTFEX.DecPrice; break; } case "TCF": { TCFMessageTFEX tCFMessageTFEX = (TCFMessageTFEX)broadcastMessage; seriesInformation = ApplicationInfo.SeriesInfo[tCFMessageTFEX.SeriesName.Trim()]; if (!string.IsNullOrEmpty(seriesInformation.Symbol)) { seriesInformation.Ceiling = tCFMessageTFEX.Ceiling; seriesInformation.Floor = tCFMessageTFEX.Floor; seriesInformation.PrevFixPrice = tCFMessageTFEX.PrevFixPrice; } break; } case "MI": { MIMessageTFEX mIMessageTFEX = (MIMessageTFEX)broadcastMessage; ApplicationInfo.IndexInfoTfex.FutureVol = mIMessageTFEX.FuturesVol; ApplicationInfo.IndexInfoTfex.FutureOI = mIMessageTFEX.FuturesOI; ApplicationInfo.IndexInfoTfex.OptionsVol = mIMessageTFEX.OptionsVol; ApplicationInfo.IndexInfoTfex.OptionsOI = mIMessageTFEX.OptionsOI; ApplicationInfo.IndexInfoTfex.TfexTotalVol = mIMessageTFEX.TotalVol; ApplicationInfo.IndexInfoTfex.TfexTotalDeal = mIMessageTFEX.TotalDeal; ApplicationInfo.IndexInfoTfex.TfexTotalOI = mIMessageTFEX.TotalOI; break; } } if (frmMain._OnMessageTfexReceived != null) { frmMain._OnMessageTfexReceived(broadcastMessage, seriesInformation); } } } } } catch (Exception ex) { this.ShowError("OnDataIn", new Exception(ex.Message + ("[" + message) + "]")); } } }
private void LoadTFEXInfomation() { try { string text = ApplicationInfo.WebServiceTFEX.TFEXInformation(); if (!string.IsNullOrEmpty(text)) { using (DataSet dataSet = new DataSet()) { MyDataHelper.StringToDataSet(text, dataSet); if (dataSet.Tables.Contains("Info") && dataSet.Tables["Info"].Rows.Count > 0) { ApplicationInfo.SeriesInfo.ResetData(); foreach (DataRow dataRow in dataSet.Tables["Info"].Rows) { SeriesList.SeriesInformation seriesInformation = new SeriesList.SeriesInformation(); seriesInformation.Symbol = dataRow["sSeries"].ToString(); int num; int.TryParse(dataRow["lOrderBookId"].ToString(), out num); seriesInformation.OrderBookId = num; int.TryParse(dataRow["lUndOrderBookId"].ToString(), out num); seriesInformation.UnderOrderBookId = num; decimal num2; decimal.TryParse(dataRow["nmrCeiling"].ToString(), out num2); seriesInformation.Ceiling = num2; decimal.TryParse(dataRow["nmrFloor"].ToString(), out num2); seriesInformation.Floor = num2; decimal.TryParse(dataRow["nmrFixPrice"].ToString(), out num2); seriesInformation.FixPrice = num2; decimal.TryParse(dataRow["nmrPrevFixPrice"].ToString(), out num2); seriesInformation.PrevFixPrice = num2; int.TryParse(dataRow["iMarketNo"].ToString(), out num); seriesInformation.MarketCode = num; int.TryParse(dataRow["iSymbolTypeNo"].ToString(), out num); seriesInformation.Group = num; decimal.TryParse(dataRow["nmrContractSize"].ToString(), out num2); seriesInformation.ContractSize = num2; seriesInformation.ExpireDate = dataRow["sExpDate"].ToString(); int.TryParse(dataRow["iOpenBalance"].ToString(), out num); seriesInformation.OpenInt = num; decimal.TryParse(dataRow["nmrStrike"].ToString(), out num2); seriesInformation.StrikPrice = num2; decimal.TryParse(dataRow["nmrPrice"].ToString(), out num2); seriesInformation.LastSalePrice = num2; decimal.TryParse(dataRow["tickSize"].ToString(), out num2); seriesInformation.TickSize = num2; seriesInformation.SeriesType = dataRow["seriesType"].ToString(); int numOfDec = 0; int.TryParse(dataRow["iDecPrice"].ToString(), out numOfDec); seriesInformation.NumOfDec = numOfDec; seriesInformation.MarketId = dataRow["sMarketId"].ToString().Trim(); ApplicationInfo.SeriesInfo.AddItem(seriesInformation); } } if (dataSet.Tables.Contains("MarketInfo") && dataSet.Tables["MarketInfo"].Rows.Count > 0) { foreach (DataRow dataRow in dataSet.Tables["MarketInfo"].Rows) { long num3; long.TryParse(dataRow["TotVolume"].ToString(), out num3); long num4; long.TryParse(dataRow["TotDeal"].ToString(), out num4); long num5; long.TryParse(dataRow["oi"].ToString(), out num5); if (dataRow["iSymbolTypeNo"].ToString() == "1") { ApplicationInfo.IndexInfoTfex.OptionsVol += num3; ApplicationInfo.IndexInfoTfex.OptionsOI += num5; ApplicationInfo.IndexInfoTfex.TfexTotalDeal += num4; } else if (dataRow["iSymbolTypeNo"].ToString() == "2") { ApplicationInfo.IndexInfoTfex.OptionsVol += num3; ApplicationInfo.IndexInfoTfex.OptionsOI += num5; ApplicationInfo.IndexInfoTfex.TfexTotalDeal += num4; } else { ApplicationInfo.IndexInfoTfex.FutureVol = num3; ApplicationInfo.IndexInfoTfex.FutureOI = num5; ApplicationInfo.IndexInfoTfex.TfexTotalDeal += num4; } } ApplicationInfo.IndexInfoTfex.TfexTotalVol = ApplicationInfo.IndexInfoTfex.FutureVol + ApplicationInfo.IndexInfoTfex.OptionsVol; ApplicationInfo.IndexInfoTfex.TfexTotalOI = ApplicationInfo.IndexInfoTfex.FutureOI + ApplicationInfo.IndexInfoTfex.OptionsOI; } if (dataSet.Tables.Contains("UnderlyingInfo") && dataSet.Tables["UnderlyingInfo"].Rows.Count > 0) { ApplicationInfo.UnderlyingInfo.ResetData(); foreach (DataRow dataRow in dataSet.Tables["UnderlyingInfo"].Rows) { UnderlyingInfo.UnderlyingList underlyingList = new UnderlyingInfo.UnderlyingList(); int num; int.TryParse(dataRow["lOrderBookId"].ToString(), out num); underlyingList.OrderBookId = num; underlyingList.Symbol = dataRow["sSymbol"].ToString().Trim(); ApplicationInfo.UnderlyingInfo.AddItem(underlyingList); } } if (ApplicationInfo.BrokerId == 4 && ApplicationInfo.IsSupportTfex) { BBOTFEXCurrency bBOTFEXCurrency = new BBOTFEXCurrency(); bBOTFEXCurrency.CurrencyName = "USD"; bBOTFEXCurrency.BidPrice = 0m; bBOTFEXCurrency.AskPrice = 0m; bBOTFEXCurrency.LastTime = "00:00:00"; bBOTFEXCurrency.LastDate = "01 January 2000"; ApplicationInfo.IndexInfoTfex.BBOCurrency.Add(bBOTFEXCurrency.CurrencyName, bBOTFEXCurrency); bBOTFEXCurrency = new BBOTFEXCurrency(); bBOTFEXCurrency.CurrencyName = "THB"; bBOTFEXCurrency.BidPrice = 0m; bBOTFEXCurrency.AskPrice = 0m; bBOTFEXCurrency.LastTime = "00:00:00"; bBOTFEXCurrency.LastDate = "01 January 2000"; ApplicationInfo.IndexInfoTfex.BBOCurrency.Add(bBOTFEXCurrency.CurrencyName, bBOTFEXCurrency); } dataSet.Clear(); } } } catch (Exception ex) { throw ex; } }
public SeriesList.SeriesInformation this[int orderBookId] { [MethodImpl(MethodImplOptions.NoInlining)] get { SeriesList.SeriesInformation result; try { if (this.items.ContainsKey(orderBookId)) { result = this.items[orderBookId]; } else { result = new SeriesList.SeriesInformation { Symbol = string.Empty }; } } catch (Exception ex) { throw ex; } return result; } }
private void tbSeries_KeyDown(object sender, KeyEventArgs e) { try { Keys keyCode = e.KeyCode; if (keyCode != Keys.Return) { switch (keyCode) { case Keys.End: case Keys.Home: case Keys.Left: case Keys.Down: e.SuppressKeyPress = true; goto IL_118; case Keys.Up: goto IL_118; case Keys.Right: break; default: goto IL_118; } } if (this.tbSeries.Text.Trim() != string.Empty) { this._seriesInfoTfex = ApplicationInfo.SeriesInfo[this.tbSeries.Text.Trim()]; if (!string.IsNullOrEmpty(this._seriesInfoTfex.Symbol) && this._seriesInfoTfex.Group != 5) { TemplateManager.Instance.SendSymbolLink(this, SymbolLinkSource.StockSymbol, this._seriesInfoTfex.Symbol); ApplicationInfo.CurrentSymbol = this._seriesInfoTfex.Symbol; this.tbVolumeT.Focus(); } else { this.tbSeries.Focus(); } } e.SuppressKeyPress = true; IL_118:; } catch (Exception ex) { this.ShowError("tbSeries_KeyUp", ex); } }
public void SetCurrentSymbol(string symbol) { if (base.InvokeRequired) { base.Invoke(new ucSendNewOrder.SetCurrentSymbolCallBack(this.SetCurrentSymbol), new object[] { symbol }); } else { this._stockInfo = ApplicationInfo.StockInfo[symbol]; if (this._stockInfo.Number > -1) { if (Settings.Default.MainBottomStyle == 5) { this.cbMMStock.Text = this._stockInfo.Symbol; if (!this.cbMMStock.Items.Contains(symbol)) { this.cbMMStock.Items.Add(symbol); } this.cbMMPrice.Text = string.Empty; this.tbMMStopPrice.Text = string.Empty; this.tbMMGiveUp.Text = string.Empty; } else { this.cbStock.Text = this._stockInfo.Symbol; if (!this.cbStock.Items.Contains(symbol)) { this.cbStock.Items.Add(symbol); } this.chbNVDR.Checked = false; this.cbDepCollateral.Text = ""; this.cbCondition.Text = string.Empty; this.cbPrice.Text = string.Empty; } } else { this._seriesInfoTfex = ApplicationInfo.SeriesInfo[symbol]; if (this._seriesInfoTfex.Symbol != string.Empty) { this.tbSeries.Text = this._seriesInfoTfex.Symbol; } } if (this._isActive) { this.StartTimerLoadCredit(); } } }
private void SetNewStock_Info(string stockSymbol, bool isFocus) { if (this.tStripMenu.InvokeRequired) { this.tStripMenu.Invoke(new frmMarketWatch.SetNewStockInfoCallBack(this.SetNewStock_Info), new object[] { stockSymbol, isFocus }); } else { try { if (!this.IsInfoLoading) { if ((stockSymbol != string.Empty && stockSymbol != this._currentStock) || ApplicationInfo.IsResumeState) { StockList.StockInformation stockInformation = ApplicationInfo.StockInfo[stockSymbol]; if (stockInformation.Number > 0) { this._stockInfoSET = stockInformation; this._seriesInfoTFEX = null; ApplicationInfo.CurrentSymbol = this._stockInfoSET.Symbol; ApplicationInfo.CurrStockInMktWatch = this._stockInfoSET.Symbol; this._currentStock = this._stockInfoSET.Symbol; TemplateManager.Instance.SendSymbolLink(this, SymbolLinkSource.SmartStock, this._currentStock); this.intzaInfo.Visible = true; this.intzaInfoTFEX.Visible = false; this.tStripBBO.SuspendLayout(); this.tsSectorName.Visible = true; this.tsSectorIndex.Visible = true; this.tsbtnHChart.Visible = true; this.tsbtnSETNews.Visible = true; this.tsbtnVolAs.Visible = true; this.tslbTfexHigh.Visible = false; this.tstbTfexHigh.Visible = false; this.tslbTfexLow.Visible = false; this.tstbTfexLow.Visible = false; this.tStripBBO.ResumeLayout(); this._currentIsSET = true; this.ReloadData(); } else { SeriesList.SeriesInformation seriesInformation = ApplicationInfo.SeriesInfo[stockSymbol]; if (seriesInformation != null & seriesInformation.Symbol != string.Empty) { this._stockInfoSET = null; this._currentIsSET = false; this._seriesInfoTFEX = seriesInformation; ApplicationInfo.CurrentSymbol = seriesInformation.Symbol; this._currentStock = seriesInformation.Symbol; this.intzaInfoTFEX.Visible = true; this.intzaInfo.Visible = false; this.tStripBBO.SuspendLayout(); this.tsSectorName.Visible = false; this.tsSectorIndex.Visible = false; this.tsbtnHChart.Visible = false; this.tsbtnSETNews.Visible = false; this.tsbtnVolAs.Visible = false; this._volAsVisible = false; this.panelVolAs.Hide(); this.tslbTfexHigh.Visible = true; this.tstbTfexHigh.Visible = true; this.tslbTfexLow.Visible = true; this.tstbTfexLow.Visible = true; this.tStripBBO.ResumeLayout(); this.ReloadData(); } } } if (this.tstbStock.Text != this._currentStock) { this.tstbStock.Text = this._currentStock; if (!ApplicationInfo.IsOrderBoxFocus && isFocus) { this.tstbStock.Focus(); this.tstbStock.SelectAll(); } } } } catch (Exception ex) { this.ShowError("SetNewStockInfo", ex); } } }