コード例 #1
0
ファイル: AssetPairsCache.cs プロジェクト: wildbunny/MT
        public bool TryGetAssetPairQuoteSubst(string substAsset, string instrument, string legalEntity,
                                              out IAssetPair assetPair)
        {
            assetPair = null;
            var baseAssetPair = GetAssetPairByIdOrDefault(instrument);

            if (baseAssetPair == null)
            {
                return(false);
            }

            return(_assetPairsByAssets.Get().TryGetValue(
                       GetAssetPairKey(baseAssetPair.BaseAssetId, substAsset, legalEntity), out assetPair));
        }
コード例 #2
0
 public IEnumerable <CrossRateCalcInfo> GetDependentAssetPairs([NotNull] string assetPairId)
 {
     if (assetPairId == null)
     {
         throw new ArgumentNullException(nameof(assetPairId));
     }
     return(_dependentAssetPairs.Get()[assetPairId].RequiredNotNullElems("result"));
 }
コード例 #3
0
        public ImmutableHashSet <string> GetAllIds()
        {
            _readerWriterLockSlim.EnterReadLock();

            try
            {
                return(_assetPairsIds.Get());
            }
            finally
            {
                _readerWriterLockSlim.ExitReadLock();
            }
        }
コード例 #4
0
        public bool TryGetAssetPairQuoteSubst(string substAsset, string instrument, string legalEntity,
                                              out IAssetPair assetPair)
        {
            _readerWriterLockSlim.EnterReadLock();

            try
            {
                assetPair = null;
                var baseAssetPair = GetAssetPairByIdOrDefault(instrument);
                if (baseAssetPair == null)
                {
                    return(false);
                }

                return(_assetPairsByAssets.Get().TryGetValue(
                           GetAssetPairKey(baseAssetPair.BaseAssetId, substAsset, legalEntity), out assetPair));
            }
            finally
            {
                _readerWriterLockSlim.ExitReadLock();
            }
        }
コード例 #5
0
 public IReadOnlyDictionary <string, AssetPairInfo> Get()
 {
     return(_assetPairs.Get());
 }
コード例 #6
0
ファイル: AssetPairsCache.cs プロジェクト: wildbunny/MT
 public ImmutableHashSet <string> GetAllIds()
 {
     return(_assetPairsIds.Get());
 }
コード例 #7
0
ファイル: DayOffSettingsService.cs プロジェクト: wildbunny/MT
 public ImmutableDictionary <string, ImmutableArray <DayOffExclusion> > GetCompiledExclusions()
 {
     return(_exclusionsByAssetPairId.Get());
 }