public FullHistoryTradeItem(TradedAsset tradedAsset, TradedCurrency tradedCurrency,
                             AssetDescription assetDescription)
 {
     Asset       = tradedAsset;
     Currency    = tradedCurrency;
     Description = assetDescription;
 }
示例#2
0
        private List <FullHistoryTradeItem> GetFullHistoryTradeItemsList(List <TradedAsset> tradedAssets,
                                                                         List <TradedCurrency> tradedCurrencies, List <AssetDescription> assetDescriptions)
        {
            var fullItems = new List <FullHistoryTradeItem>();

            if (tradedAssets == null)
            {
                return(fullItems);
            }

            foreach (var asset in tradedAssets)
            {
                TradedCurrency currency = null;
                if (tradedCurrencies != null)
                {
                    tradedCurrencies.FirstOrDefault(curr =>
                                                    curr.ClassId == asset.ClassId && curr.ContextId == asset.ContextId);
                }

                var description = assetDescriptions.FirstOrDefault(descr =>
                                                                   asset.ClassId == descr.ClassId && asset.InstanceId == descr.InstanceId);

                fullItems.Add(new FullHistoryTradeItem(asset, currency, description));
            }

            return(fullItems);
        }