public void AddOrder(Order order) { App.Current.Dispatcher.Invoke(() => { this.Orders.Insert(0, order); }); }
public override void OnRtnOrder(ThostFtdcOrderField pOrder) { var order = new Order { InstrumentID = pOrder.InstrumentID, UserID = pOrder.UserID, Direction = (DirectionType)pOrder.Direction, CombOffsetFlag = (OffsetFlag)pOrder.CombOffsetFlag_0, LimitPrice = pOrder.LimitPrice, VolumeTotalOriginal = pOrder.VolumeTotalOriginal, OrderSubmitStatus = (OrderSubmitStatus)pOrder.OrderSubmitStatus, OrderStatus = (OrderStatus)pOrder.OrderStatus, VolumeTraded = pOrder.VolumeTraded, VolumeTotal = pOrder.VolumeTotal, InsertTime = DateTimeHelper.GenerateTime(pOrder.InsertDate, pOrder.InsertTime), StatusMsg = pOrder.StatusMsg, }; OrderRecordViewModel.Instance.AddOrder(order); }