Exemplo n.º 1
0
 public override void OnRspQryInstrument(ThostFtdcInstrumentField pInstrument, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     this.instruments.Add(new Instrument(pInstrument));
     if (bIsLast)
     {
         string[] instrumentIDs = this.instruments.Select(p => p.InstrumentID).ToArray();
         MdAdapter.Instance.Start(instrumentIDs);
         Instrument[] instruments = this.instruments.OrderBy(p => p.InstrumentID).ToArray();
         InstrumentListViewModel.Instance.Instruments = instruments;
         InstrumentDAL.Save(instruments);
     }
 }
Exemplo n.º 2
0
        private async void Init()
        {
            await DALUtil.Init();

            InstrumentListViewModel.Instance.Instruments = await Task.Run(() => { return(InstrumentDAL.Get()); });

            await Task.Run(() => { QuotationCenter.Init(); });

            QuotationListViewModel.Instance.Init();
            TradeAdapter.Instance.Start();
            this.IsBusy = false;
        }