void trader_ReturnOrderResponse(object sender, EsunnyEventArgs <TEsOrderInsertRspField> e) { if (this.InvokeRequired) { this.Invoke(new Action(() => { EsunnyInputOrder order = EsunnyConvert.ConvertOrder(e.Value); int i = orders.IndexOf(order); if (i < 0) { orders.Add(order); } else { EsunnyInputOrder data = orders[i]; data.OrderTradeStatus = order.OrderTradeStatus; data.TradeVolume = order.TradeVolume; data.Message = order.Message; orders.ResetItem(i); } })); } }
void trader_QueryOrderResponse(object sender, EsunnyEventArgs <List <TEsOrderInsertRspField> > e) { if (this.InvokeRequired) { this.Invoke(queryOrderResponse, sender, e); } else { foreach (var item in e.Value) { EsunnyInputOrder order = EsunnyConvert.ConvertOrder(item); int i = orders.IndexOf(order); if (i < 0) { orders.Add(order); } else { EsunnyInputOrder data = orders[i]; data.OrderTradeStatus = order.OrderTradeStatus; data.TradeVolume = order.TradeVolume; data.Message = order.Message; orders.ResetItem(i); } } } }
void quote_QuoteResponse(object sender, EsunnyEventArgs <TEsQuoteRspField> e) { if (this.InvokeRequired) { this.Invoke(new Action(() => { Log(string.Format("{0} : {1} {2} {3}", e.Value.Exchange, e.Value.Contract, e.Value.Buy, e.Value.Sell)); })); } }
void trader_QueryMoneyResponse(object sender, EsunnyEventArgs <TEsMoneyRspField> e) { if (this.InvokeRequired) { this.Invoke(queryMoneyResponse, sender, e); } else { this.idOrderBindingSource.DataSource = e.Value; } }
void trader_QueryCommodityResponse(object sender, EsunnyEventArgs <List <TEsCommodityRspField> > e) { if (this.InvokeRequired) { this.Invoke(queryCommodityResponse, sender, e); } else { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Commodity, item.Dot)); } } }
void trader_QueryContractResponse(object sender, EsunnyEventArgs <List <TEsContractRspField> > e) { if (this.InvokeRequired) { this.Invoke(queryContractResponse, sender, e); } else { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Contract, item.EndTradeDay)); this.symbolCodeComboBox1.Properties.Items.Add(item); } } }
void trader_QueryExchangeStateResponse(object sender, EsunnyEventArgs <List <TEsExchangeStateRspField> > e) { if (this.InvokeRequired) { this.Invoke(queryExchangeStateResponse, sender, e); } else { StringBuilder buffer = new StringBuilder(); foreach (var item in e.Value) { buffer.AppendFormat("{0}:{1} ", item.Exchange, item.ExchangeState); } Log(buffer.ToString()); } }
void trader_QueryCmbContractResponse(object sender, EsunnyEventArgs <List <TEsCmbContractRspField> > e) { if (this.InvokeRequired) { this.Invoke(new Action(() => { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2)); } })); } else { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2)); } } }
void trader_ReturnOrderResponse(object sender, EsunnyEventArgs<TEsOrderInsertRspField> e) { if (this.InvokeRequired) { this.Invoke(new Action(() => { EsunnyInputOrder order = EsunnyConvert.ConvertOrder(e.Value); int i = orders.IndexOf(order); if (i < 0) { orders.Add(order); } else { EsunnyInputOrder data = orders[i]; data.OrderTradeStatus = order.OrderTradeStatus; data.TradeVolume = order.TradeVolume; data.Message = order.Message; orders.ResetItem(i); } })); } }
void trader_QueryOrderResponse(object sender, EsunnyEventArgs<List<TEsOrderInsertRspField>> e) { if (this.InvokeRequired) { this.Invoke(queryOrderResponse, sender, e); } else { foreach (var item in e.Value) { EsunnyInputOrder order = EsunnyConvert.ConvertOrder(item); int i =orders.IndexOf(order); if (i < 0) { orders.Add(order); } else { EsunnyInputOrder data = orders[i]; data.OrderTradeStatus = order.OrderTradeStatus; data.TradeVolume = order.TradeVolume; data.Message = order.Message; orders.ResetItem(i); } } } }
void trader_QueryMoneyResponse(object sender, EsunnyEventArgs<TEsMoneyRspField> e) { if (this.InvokeRequired) { this.Invoke(queryMoneyResponse, sender, e); } else { this.idOrderBindingSource.DataSource = e.Value; } }
void trader_QueryExchangeStateResponse(object sender, EsunnyEventArgs<List<TEsExchangeStateRspField>> e) { if (this.InvokeRequired) { this.Invoke(queryExchangeStateResponse, sender, e); } else { StringBuilder buffer = new StringBuilder(); foreach (var item in e.Value) { buffer.AppendFormat("{0}:{1} ",item.Exchange,item.ExchangeState); } Log(buffer.ToString()); } }
void trader_QueryContractResponse(object sender, EsunnyEventArgs<List<TEsContractRspField>> e) { if (this.InvokeRequired) { this.Invoke(queryContractResponse, sender, e); } else { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Contract, item.EndTradeDay)); this.symbolCodeComboBox1.Properties.Items.Add(item); } } }
void trader_QueryCommodityResponse(object sender, EsunnyEventArgs<List<TEsCommodityRspField>> e) { if (this.InvokeRequired) { this.Invoke(queryCommodityResponse, sender, e); } else { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.Name, item.Commodity, item.Dot)); } } }
void trader_QueryCmbContractResponse(object sender, EsunnyEventArgs<List<TEsCmbContractRspField>> e) { if (this.InvokeRequired) { this.Invoke(new Action(() => { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2)); } })); } else { foreach (var item in e.Value) { Log(string.Format("{0} : {1} {2} {3}", item.Exchange, item.CmbType, item.Contract1, item.Contract2)); } } }
void quote_QuoteResponse(object sender, EsunnyEventArgs<TEsQuoteRspField> e) { if (this.InvokeRequired) { this.Invoke(new Action(() => { Log(string.Format("{0} : {1} {2} {3}", e.Value.Exchange, e.Value.Contract, e.Value.Buy, e.Value.Sell)); })); } }