Example #1
0
        /// <summary>Initializes a new instance of the <see cref="ReadOnlyMarketConventions"/> class.
        /// </summary>
        /// <param name="bondMarketConventions">The bond market conventions.</param>
        /// <param name="creditMarketConventions">The credit market conventions.</param>
        /// <param name="inflationMarketConventions">The inflation market conventions.</param>
        /// <param name="moneyMarketConventions">The money market conventions.</param>
        /// <param name="swapMarketConventions">The swap market conventions.</param>
        /// <exception cref="ArgumentNullException">Thrown, if one of the arguments is <c>null</c>.</exception>
        public ReadOnlyMarketConventions(ReadOnlyBondMarketConventions bondMarketConventions, ReadOnlyCreditMarketConventions creditMarketConventions, ReadOnlyInflationMarketConventions inflationMarketConventions, ReadOnlyMoneyMarketConventions moneyMarketConventions, ReadOnlySwapMarketConventions swapMarketConventions)
        {
            if (bondMarketConventions == null)
            {
                throw new ArgumentNullException("bondMarketConventions");
            }
            BondMarketConventions = bondMarketConventions;

            if (creditMarketConventions == null)
            {
                throw new ArgumentNullException("creditMarketConventions");
            }
            CreditMarketConventions = creditMarketConventions;

            if (inflationMarketConventions == null)
            {
                throw new ArgumentNullException("inflationMarketConventions");
            }
            InflationMarketConventions = inflationMarketConventions;

            if (moneyMarketConventions == null)
            {
                throw new ArgumentNullException("moneyMarketConventions");
            }
            MoneyMarketConventions = moneyMarketConventions;

            if (swapMarketConventions == null)
            {
                throw new ArgumentNullException("swapMarketConventions");
            }
            SwapMarketConventions = swapMarketConventions;
        }
 /// <summary>Adds default market conventions that are taken into account into a specific logger.
 /// </summary>
 /// <param name="logger">The logger.</param>
 /// <param name="marketConventions">The market conventions which are taken into account.</param>
 /// <param name="userMarketConventionInput">The user input of market conventions.</param>
 public static void Add_Info(this ILogger logger, ReadOnlySwapMarketConventions marketConventions, SwapMarketConventions userMarketConventionInput = null)
 {
     if ((logger != null) && (marketConventions != null))
     {
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.BusinessDaysToSettleState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Business days to settle", marketConventions.BusinessDaysToSettle);
         //}
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.FixingLagState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Fixing Lag", marketConventions.FixingLag.Name);
         //}
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.FixedBusinessDayConventionState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Fixed Business day convention", marketConventions.FixedBusinessDayConvention.Name);
         //}
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.FixedDayCountConventionState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Fixed Day Count convention", marketConventions.FixedDayCountConvention.Name);
         //}
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.FixedFrequencyState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Fixed frequency", marketConventions.FixedFrequency.Name);
         //}
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.FloatingBusinessDayConventionState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Floating Business day convention", marketConventions.FloatingBusinessDayConvention.Name);
         //}
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.FloatingDayCountConventionState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Floating Day Count convention", marketConventions.FloatingDayCountConvention.Name);
         //}
         //if ((userMarketConventionInput == null) || (userMarketConventionInput.FloatingFrequencyState != ConventionState.UserInput))
         //{
         //    logger.Add_Info_StandardValue("Floating frequency", marketConventions.FloatingFrequency.Name);
         //}
     }
 }