示例#1
0
        /// <summary>
        /// Adds a given exchange rate into cache
        /// </summary>
        /// <param name="exRate">The exchange rate object</param>
        internal void InsertExchangeRateToCache(BudgetExchangeRate exRate)
        {
            bool found = false;

            //Insert the budget exchange rate into the cache only if it is not already in the cache
            foreach (BudgetExchangeRate rate in exchangeRatesCache)
            {
                if (exRate.CompareWithObject(rate))
                {
                    found = true;
                    break;
                }
            }
            if (!found)
            {
                exchangeRatesCache.Add(exRate);
            }
        }