Пример #1
0
        /// <summary>Initializes a new instance of the <see cref="DayCountConvention"/> class.
        /// </summary>
        static DayCountConvention()
        {
            sm_Pool = new IdentifierNameableDictionary <IDayCountConvention>(Actual360, Actual365, Actual365_25, ActualActual.AFB, ActualActual.ISDA, ActualActual.ISMA,
                                                                             OneOverOne, Thirty360, ThirtyE360);

//            sm_Logger = Logger.Stream.Create("Pool", typeof(DayCountConvention), "Day count convention", "Pool");
        }
Пример #2
0
        /// <summary>Initializes the <see cref="ObjectStreamer"/> class.
        /// </summary>
        static ObjectStreamer()
        {
            sm_Pool = new IdentifierNameableDictionary <IObjectStreamer>();

            /* do not allow replacing pool elements: */
            sm_Pool.Adding += (sender, eventArgs) => { eventArgs.Cancel = ((eventArgs.OldItem != null) && (eventArgs.NewItem.Name.IDString == eventArgs.OldItem.Name.IDString)); };
        }
Пример #3
0
        /// <summary>Initializes a new instance of the <see cref="ZeroRateCompounding"/> class.
        /// </summary>
        internal ZeroRateCompounding()
        {
            m_Pool = new IdentifierNameableDictionary <IZeroRateCompounding>(Continuously, Annually, SemiAnnually, Quarterly, BiMonthly, Monthly, Daily);

            //m_LoggingStream = Logger.Stream.Create("Pool", typeof(ZeroRateCompounding), "Zero rate Compounding convention", "Pool");
            m_LoggingStream = Logger.Stream.CreateLogger(typeof(ZeroRateCompounding));
        }
        /// <summary>Initializes a new instance of the <see cref="InterestRateCompounding"/> class.
        /// </summary>
        internal InterestRateCompounding()
        {
            m_Pool = new IdentifierNameableDictionary <IInterestRateCompounding>(Simple, Continuously, Annually, SemiAnnually, Quarterly, BiMonthly, Monthly, Daily,
                                                                                 SimpleThenAnnually, SimpleThenSemiAnnually, SimpleThenQuarterly, SimpleThenBiMonthly, SimpleThenMonthly, SimpleThenDaily);

            m_LoggingStream = Logger.Stream.CreateLogger(typeof(InterestRateCompounding)); // .Stream.Create("Pool", typeof(InterestRateCompounding), "Interest Compounding convention", "Pool");
        }
Пример #5
0
        /// <summary>Initializes a new instance of the <see cref="BusinessDayConvention"/> class.
        /// </summary>
        static BusinessDayConvention()
        {
            sm_Pool = new IdentifierNameableDictionary <IBusinessDayConvention>(NoAdjustment, Following, ModFollowing, Preceding,
                                                                                EndOfMonth, EndOfMonthFollowing, EndOfMonthPreceding, EndOfMonthIgnoreLeapYears,
                                                                                EndOfQuarter, EndOfQuarterPreceding, EndOfQuarterFollowing,
                                                                                ThirdWednesday, TwoBusinessDaysPriorThirdWednesday);

//            sm_Logger = Logger.Stream.Create("Pool", typeof(BusinessDayConvention), "Business day convention", "Pool");
        }
Пример #6
0
        /// <summary>Initializes a new instance of the <see cref="RoundingRule"/> class.
        /// </summary>
        static RoundingRule()
        {
            sm_RoundingRuleTypes = new Dictionary <string, Type>();
            sm_RoundingRuleTypes.Add(Miscellaneous.BankersRounding.RoundingName.IDString, typeof(BankersRounding));
            sm_RoundingRuleTypes.Add(CeilingRounding.RoundingName.IDString, typeof(CeilingRounding));
            sm_RoundingRuleTypes.Add(TruncateRounding.RoundingName.IDString, typeof(TruncateRounding));
            sm_RoundingRuleTypes.Add(FloorRounding.RoundingName.IDString, typeof(FloorRounding));

            sm_Pool = GetInitialCollection();
        }
Пример #7
0
        /// <summary>Initializes the <see cref="HolidayCalendar"/> class.
        /// </summary>
        static HolidayCalendar()
        {
//            sm_Logger = Logger.Stream.Create("Pool", typeof(HolidayCalendar), "Holiday calendar", "Pool");

            sm_Pool = new IdentifierNameableDictionary <IHolidayCalendar>();

            Initialize += Africa.RegisterHolidayCalendars;
            Initialize += America.RegisterHolidayCalendars;
            Initialize += Asia.RegisterHolidayCalendars;
            Initialize += Europe.RegisterHolidayCalendars;
            Initialize += Oceania.RegisterHolidayCalendars;
        }
Пример #8
0
        /// <summary>Raises the <see cref="Initialize"/> event.
        /// </summary>
        private static void OnInitialize()
        {
            if (sm_InitializeChanged == true)
            {
                /* first clear all ExcelPoolItemCreater objects */
                sm_ObjectCreatorsByGuid.Clear();
                sm_ObjectCreatorsByName = new IdentifierNameableDictionary <ExcelPoolItemCreator>(100, isReadOnlyExceptAdding: true);  // clear is not allowed, it is readonly

                /* add all ExcelPoolItemCreator objects */
                if (sm_Initialize != null)
                {
                    InitializeEventArgs eventArgs = new InitializeEventArgs();
                    sm_Initialize(eventArgs);
                }
                sm_InitializeChanged = false;
            }
        }
Пример #9
0
        /// <summary>Raises the <see cref="Initialize"/> event.
        /// </summary>
        private static void OnInitialize()
        {
            if (sm_InitializeChanged == true)
            {
                /* first remove all IHolidayCalendar objects */
                sm_Pool = new IdentifierNameableDictionary <IHolidayCalendar>(100, isReadOnlyExceptAdding: true);  // clear is not allowed, it is readonly
                sm_Pool.Add(EmptyHolidayCalendar);
                sm_Pool.Add(WeekendCalendar);

                /* add all IHolidayCalendar objects */
                if (sm_Initialize != null)
                {
                    InitializeEventArgs eventArgs = new InitializeEventArgs();
                    sm_Initialize(eventArgs);
                }
                sm_InitializeChanged = false;
            }
        }
Пример #10
0
        /// <summary>Initializes a new instance of the <see cref="Currency"/> class.
        /// </summary>
        static CommonCurrency()
        {
//            sm_Logger = Logger.Stream.Create("Pool", typeof(Currency), "Currency", "Pool");

            Africa  = new CurrencyCollection.Africa();
            America = new CurrencyCollection.America();
            Asia    = new CurrencyCollection.Asia();
            Europe  = new CurrencyCollection.Europe();
            Oceania = new CurrencyCollection.Oceania();

            sm_Pool = new Lazy <IdentifierNameableDictionary <Currency> >(
                () =>
            {
                var commonCurrencyPool = new IdentifierNameableDictionary <Currency>(100, isReadOnlyExceptAdding: true);     // clear is not allowed, it is readonly

                Africa.FillPool(commonCurrencyPool);
                America.FillPool(commonCurrencyPool);
                Asia.FillPool(commonCurrencyPool);
                Europe.FillPool(commonCurrencyPool);
                Oceania.FillPool(commonCurrencyPool);
                return(commonCurrencyPool);
            });
        }
Пример #11
0
 /// <summary>Adds the <see cref="Currency"/> objects provided by the current object into a specific <see cref="IdentifierNameableDictionary{Currency}"/> object.
 /// </summary>
 /// <param name="commonCurrencyPool">The common currency pool.</param>
 internal void FillPool(IdentifierNameableDictionary <Currency> commonCurrencyPool)
 {
 }
Пример #12
0
 /// <summary>Initializes the <see cref="DateScheduleFrequency"/> class.
 /// </summary>
 static DateScheduleFrequency()
 {
     sm_Pool = new IdentifierNameableDictionary <IDateScheduleFrequency>(Annually, SemiAnnually, Quarterly, BiMonthly, Monthly, EveryForWeeks, Weekly, Daily, Once);
 }
 /// <summary>Adds the <see cref="Currency"/> objects provided by the current object into a specific <see cref="IdentifierNameableDictionary{Currency}"/> object.
 /// </summary>
 /// <param name="commonCurrencyPool">The common currency pool.</param>
 internal void FillPool(IdentifierNameableDictionary <Currency> commonCurrencyPool)
 {
     commonCurrencyPool.Add(EUR);
     commonCurrencyPool.Add(GBP);
 }
Пример #14
0
 /// <summary>Initializes a new instance of the <see cref="IRCapletTenorConvention"/> class.
 /// </summary>
 static IRCapletTenorConvention()
 {
     sm_Pool = new IdentifierNameableDictionary <IIRCapletTenorConvention>(CapletTenor3M, CapletTenor6M, CapletTenor3MUntil2YThen6M);
     // sm_Logger = Logger.Stream.Create("Pool", typeof(IRCapletTenorConvention), "Caplet tenor convention", "Pool");
 }