Example #1
0
        public RateDepositControl()
        {
            InitializeComponent();

            EnumConversion.InitializeComboFromEnum <ratetype>(this.comboTyp);
            EnumConversion.InitializeComboFromEnum <termbase>(this.comboTer);
            CachedData.InitializeCurrencyComboFromCache(this.comboCur);
            //CachedData.InitializeCalendarComboFromCache(this.comboMar);

            EnumConversion.InitializeComboFromEnum <basis>(this.comboBas);
            EnumConversion.InitializeComboFromEnum <compounding>(this.comboMod);
            EnumConversion.InitializeComboFromEnum <frequency>(this.comboFre);
            EnumConversion.InitializeComboFromEnum <BusinessDayConvention>(this.comboBus);
        }
Example #2
0
        public DiscountSettingsGUI()
        {
            InitializeComponent();

            EnumConversion.InitializeComboFromEnum <compounding>(this.comboBox1);
            EnumConversion.InitializeComboFromEnum <basis>(this.comboBox2);
            EnumConversion.InitializeComboFromEnum <compounding>(this.comboBox3);
            EnumConversion.InitializeComboFromEnum <basis>(this.comboBox4);
            EnumConversion.InitializeComboFromEnum <frequency>(this.comboBox5);
            EnumConversion.InitializeComboFromEnum <frequency>(this.comboBox6);
            EnumConversion.InitializeComboFromEnum <termbase>(this.comboBox7);

            if (CurrentElements.CurrentYCId != -1)
            {
                SetControlsFromSettingsForYC(CurrentElements.CurrentYCId);
            }
        }
Example #3
0
        public void Init(Bond b)
        {
            String CurCode = (CachedData.CachedCurrencyDic.ContainsKey(b.IdCcy)
                                                                ? CachedData.CachedCurrencyDic[b.IdCcy].Code
                                                                : "");

            this.comboCur.SelectedItem = CurCode;
            this.txtBoxRef.Text        = b.Name;
            this.comboFre.SelectedItem = EnumConversion.getStringFromEnum(EnumConversion.getFrequencyFromString(b.CouponFrequency));
            this.comboTyp.SelectedItem = EnumConversion.getStringFromEnum(bondtype.Fixed);

            this.txtBoxNom.Text                  = b.Nominal.ToString();
            this.txtBoxRed.Text                  = b.Redemption.ToString();
            this.txtBoxCoupon.Text               = b.Coupon.ToString();
            this.datePickerIssue.SelectedDate    = b.IssueDate;
            this.datePickerMaturity.SelectedDate = b.MaturityDate;
        }
Example #4
0
        public RateGUI()
        {
            InitializeComponent();
            //initializeBasisCombo();
            //Dropdown.InitializeBasisCombo(this.comboBas);
            EnumConversion.InitializeComboFromEnum <basis>(this.comboBas);
            //Dropdown.InitializeComboFromEnum<basis>(this.comboBas);
            EnumConversion.InitializeComboFromEnum <compounding>(this.comboMod);
            EnumConversion.InitializeComboFromEnum <frequency>(this.comboFre);
            EnumConversion.InitializeComboFromEnum <ratetype>(this.comboTyp);
            EnumConversion.InitializeComboFromEnum <termbase>(this.comboTer);
            EnumConversion.InitializeComboFromEnum <BusinessDayConvention>(this.comboBus);
            CachedData.InitializeCurrencyComboFromCache(this.comboCur);

            EnumConversion.InitializeComboFromEnum <basis>(this.comboIBas);
            EnumConversion.InitializeComboFromEnum <compounding>(this.comboIMod);
            EnumConversion.InitializeComboFromEnum <frequency>(this.comboIFre);
        }
Example #5
0
        public NewSettings()
        {
            InitializeComponent();

            EnumConversion.InitializeComboFromEnum <compounding>(this.comboBox_ZCcomp);
            EnumConversion.InitializeComboFromEnum <basis>(this.comboBox_ZCbas);
            EnumConversion.InitializeComboFromEnum <compounding>(this.comboBox_FRWcomp);
            EnumConversion.InitializeComboFromEnum <basis>(this.comboBox_FRWbas);
            EnumConversion.InitializeComboFromEnum <frequency>(this.comboBox_ZCfre);
            EnumConversion.InitializeComboFromEnum <frequency>(this.comboBox_FRWfre);
            EnumConversion.InitializeComboFromEnum <termbase>(this.comboBox_FRWterm);

            if (CurrentElements.CurrentYCId != -1)
            {
                SetControlsFromSettingsForYC(CurrentElements.CurrentYCId);
            }

            this.textBox_decimal.Text     = AppSettings.Decimals.ToString();
            this.colorPicker_curve1.Color = AppSettings.FirstCurveColor;
            this.colorPicker_curve2.Color = AppSettings.SecondCurveColor;
        }
Example #6
0
        public static void InitializeComboFromEnum <T>(ComboBox c)
        {
            c.Items.Clear();

            Type enumType = typeof(T);

            foreach (FieldInfo com in enumType.GetFields(BindingFlags.Public | BindingFlags.Static))
            {
                if (enumType == typeof(basis))
                {
                    c.Items.Add(EnumConversion.getStringFromEnum((basis)Enum.Parse(typeof(basis), com.Name, true)));
                }
                else if (enumType == typeof(BusinessDayConvention))
                {
                    c.Items.Add(EnumConversion.getStringFromEnum((BusinessDayConvention)Enum.Parse(typeof(BusinessDayConvention), com.Name, true)));
                }
                else if (enumType == typeof(compounding))
                {
                    c.Items.Add(EnumConversion.getStringFromEnum((compounding)Enum.Parse(typeof(compounding), com.Name, true)));
                }
                else if (enumType == typeof(frequency))
                {
                    c.Items.Add(EnumConversion.getStringFromEnum((frequency)Enum.Parse(typeof(frequency), com.Name, true)));
                }
                else if (enumType == typeof(ratetype))
                {
                    c.Items.Add(EnumConversion.getStringFromEnum((ratetype)Enum.Parse(typeof(ratetype), com.Name, true)));
                }
                else if (enumType == typeof(bondtype))
                {
                    c.Items.Add(EnumConversion.getStringFromEnum((bondtype)Enum.Parse(typeof(bondtype), com.Name, true)));
                }
                else if (enumType == typeof(termbase))
                {
                    c.Items.Add(EnumConversion.getStringFromEnum((termbase)Enum.Parse(typeof(termbase), com.Name, true)));
                }

                // c.Items.Add(com.Name);
            }
        }
Example #7
0
        public void InitData()
        {
            EnumConversion.InitializeComboFromEnum <ratetype>(this.comboBox1);

            foreach (Rate i in CachedData.CachedRatesDic.Values)
            {
                if (i.Type == ratetype.deposit.ToString())
                {
                    rd.Add(i);
                }
                else if (i.Type == ratetype.swap.ToString())
                {
                    rs.Add(i);
                }
            }

            this.comboBox1.SelectedIndex        = 0;      // rate deposit
            this.rateDepositControl1.Visibility = System.Windows.Visibility.Visible;

            this.rateSwapControl1.Visibility = System.Windows.Visibility.Collapsed;
            this.bondControl1.Visibility     = System.Windows.Visibility.Collapsed;
        }