コード例 #1
0
        /// <summary>
        /// Tries to get the algorithm.
        /// </summary>
        /// <param name="nameSpace"></param>
        /// <param name="pricingStructureType"></param>
        /// <param name="algorithmName"></param>
        /// <param name="logger"></param>
        /// <param name="cache">The value</param>
        /// <returns>Whether the property existed or not</returns>
        public Algorithm GetAlgorithm(ILogger logger, ICoreCache cache, String nameSpace, PricingStructureTypeEnum pricingStructureType, string algorithmName)
        {
            Algorithm algorithm = null;

            if (cache != null)
            {
                try
                {
                    algorithm = cache.LoadObject <Algorithm>(nameSpace + "." + AlgorithmsProp.GenericName + "." + pricingStructureType + "." + algorithmName);
                }
                catch (Exception ex)
                {
                    logger.Log(ex);
                }
            }
            return(algorithm);
        }
コード例 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="logger"></param>
 /// <param name="cache"></param>
 /// <param name="nameSpace"></param>
 /// <param name="pricingStructureType"></param>
 /// <param name="algorithmName"></param>
 public PricingStructureAlgorithmsHolder(ILogger logger, ICoreCache cache, String nameSpace, PricingStructureTypeEnum pricingStructureType, string algorithmName)
 {
     if (cache != null)
     {
         _pricingStructureAlgorithm = GetAlgorithm(logger, cache, nameSpace, pricingStructureType, algorithmName);
     }
 }