Пример #1
0
 public void Add(Account account, string rawData, CacheType cacheType)
 {
     lock (_lock)
     {
         CacheData cacheData = this.CreateCacheData(account, rawData, cacheType);
         if (cacheType == CacheType.Transaciton || cacheType == CacheType.HistoryOrder)
         {
             _recordManager.Persistent(cacheData);
             CacheFileManager.Copy(cacheData.FilePath);
             this.AddForTradingData(cacheData);
         }
         else if (cacheType == CacheType.Reset)
         {
             _recordManager.Persistent(cacheData);
             CacheFileManager.Move(cacheData.FilePath);
             _resetSaver.Add(cacheData);
         }
     }
 }
Пример #2
0
        private void AddCacheData(Dictionary <Guid, List <CacheData> > accountCacheDatas, CacheData cacheData)
        {
            List <CacheData> cacheDataList;

            if (!accountCacheDatas.TryGetValue(cacheData.AccountId, out cacheDataList))
            {
                cacheDataList = new List <CacheData>();
                accountCacheDatas.Add(cacheData.AccountId, cacheDataList);
            }
            cacheDataList.Add(cacheData);
        }
Пример #3
0
 private void AddForTradingData(CacheData cacheData)
 {
     _tradingDataSaver.Add(cacheData);
 }