예제 #1
0
파일: Program.cs 프로젝트: ychaim/qdms
 static void client_LocallyAvailableDataInfoReceived(object sender, LocallyAvailableDataInfoReceivedEventArgs e)
 {
     foreach (StoredDataInfo s in e.StorageInfo)
     {
         Console.WriteLine("Freq: {0} - From {1} to {2}", s.Frequency, s.EarliestDate, s.LatestDate);
     }
 }
예제 #2
0
파일: QDMS.cs 프로젝트: QANTau/QPAS
        private void DataClient_LocallyAvailableDataInfoReceived(object sender, LocallyAvailableDataInfoReceivedEventArgs e)
        {
            if (e.Instrument.ID == null) throw new Exception("Null instrument ID return wtf");
            int id = e.Instrument.ID.Value;
            lock (_storageInfoLock)
            {
                StoredDataInfo info = e.StorageInfo.FirstOrDefault(x => x.Frequency == BarSize.OneDay);
                if (info == null) return;

                if (_storageInfo.ContainsKey(id))
                    _storageInfo[id] = info;
                else
                    _storageInfo.Add(id, info);
            }
        }