当前位置: 首页>>代码示例>>C#>>正文


C# Element.GetElementAsInt32方法代码示例

本文整理汇总了C#中Element.GetElementAsInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Element.GetElementAsInt32方法的具体用法?C# Element.GetElementAsInt32怎么用?C# Element.GetElementAsInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Element的用法示例。


在下文中一共展示了Element.GetElementAsInt32方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SecurityData

        public SecurityData(ReferenceDataResponse context, Element securityData)
            : this(context.GetDescription())
        {
            _securityData = securityData;
            Security = _securityData.GetElementAsString("security");
            SequenceNr = _securityData.GetElementAsInt32("sequenceNumber");

            if (_securityData.HasElement("securityError"))
            {
                _securityError = new SecurityError(_securityData.GetElement("securityError"));
            }
            else
            {
                if (_securityData.HasElement("fieldData"))
                {
                    Element _fieldDataArray = _securityData.GetElement("fieldData");
                    for (int i = 0; i < context.Fields.Count; i++)
                    {
                        if (_fieldDataArray.HasElement(context.Fields[i]))
                        {
                            var field = new FieldData(_fieldDataArray.GetElement(context.Fields[i]));
                            Fields[field.Name] = field;
                        }
                    }
                }

                if (_securityData.HasElement("fieldExceptions"))
                {
                    Element _fieldExceptionsArray = _securityData.GetElement("fieldExceptions");
                    for (int i = 0; i < _fieldExceptionsArray.NumValues; i++)
                    {
                        FieldExceptions.Add(new FieldException(_fieldExceptionsArray.GetValueAsElement(i)));
                    }
                }
            }
        }
开发者ID:tweakch,项目名称:TweakToolkit,代码行数:36,代码来源:SecurityData.cs

示例2: ParseGovt

        private static void ParseGovt(Element fieldData, string security)
        {
            Govt govt;
            try
            {
                string country = fieldData.GetElementAsString("COUNTRY_ISO");
                double px_last = fieldData.GetElementAsFloat64("PX_LAST");
                string currency = fieldData.GetElementAsString("DDIS_CURRENCY");
                string name = fieldData.GetElementAsString("NAME");
                int id_Mcorp = fieldData.GetElementAsInt32("ID_BB_ULTIMATE_PARENT_CO");
                string name_Mcorp = fieldData.GetElementAsString("ID_BB_ULTIMATE_PARENT_CO_NAME");
                double duration = fieldData.GetElementAsFloat64("YAS_MOD_DUR");
                string maturity = fieldData.GetElementAsString("MATURITY");

                string date_cpn = fieldData.GetElementAsString("NXT_CPN_DT");
                int nb_day_nxt_cpn = fieldData.GetElementAsInt32("DAYS_TO_NEXT_COUPON");
                double cpn = fieldData.GetElementAsFloat64("CPN");
                int cpn_freq = fieldData.GetElementAsInt32("CPN_FREQ");

                int rating = Rating.GetQuality(fieldData);

                govt = new Govt(security, d_title[security].Item1, country, currency, name, px_last, id_Mcorp, name_Mcorp, rating, d_title[security].Item2,date_cpn, maturity, duration, cpn, cpn_freq, nb_day_nxt_cpn);
            }
            catch (NotFoundException e)
            {
                govt = new Govt(security, d_title[security].Item1, d_title[security].Item2, e.Description());
            }
            l_title.Add(govt);
        }
开发者ID:TigerSCR,项目名称:TigerAppWPF,代码行数:29,代码来源:Connector.cs

示例3: ParseEquity

        private static void ParseEquity(Element fieldData, string security)
        {
            Equity equit;
            try
            {
                string country = fieldData.GetElementAsString("COUNTRY_ISO");
                double px_last = fieldData.GetElementAsFloat64("PX_LAST");
                string currency = fieldData.GetElementAsString("DDIS_CURRENCY");
                string name = fieldData.GetElementAsString("NAME");
                int id_Mcorp = fieldData.GetElementAsInt32("ID_BB_ULTIMATE_PARENT_CO");
                string name_Mcorp = fieldData.GetElementAsString("ID_BB_ULTIMATE_PARENT_CO_NAME");

                int rating = Rating.GetQuality(fieldData);

                equit = new Equity(security, d_title[security].Item1, country, currency, name, px_last, id_Mcorp, name_Mcorp,rating);
            }
            catch (NotFoundException e)
            {
                equit = new Equity(security, d_title[security].Item1, e.Description());
            }
            l_title.Add(equit);
        }
开发者ID:TigerSCR,项目名称:TigerAppWPF,代码行数:22,代码来源:Connector.cs

示例4: ParseGovt

        private static void ParseGovt(Element fieldData, string security)
        {
            /*valeur actuel = qt* nominale*/
            Govt govt;
            string name = "";
            try
            {
                name = fieldData.GetElementAsString("NAME");
                string maturity = fieldData.GetElementAsString("MATURITY");
                if (Convert.ToDateTime(maturity) > DateTime.Now)
                {
                    string country = fieldData.GetElementAsString("COUNTRY_ISO");
                    double px_last = fieldData.GetElementAsFloat64("PX_LAST");
                    string currency = fieldData.GetElementAsString("DDIS_CURRENCY");
                    int id_Mcorp = fieldData.GetElementAsInt32("ID_BB_ULTIMATE_PARENT_CO");
                    string name_Mcorp = fieldData.GetElementAsString("ID_BB_ULTIMATE_PARENT_CO_NAME");
                    double duration = fieldData.GetElementAsFloat64("YAS_MOD_DUR");

                    string date_cpn = fieldData.GetElementAsString("NXT_CPN_DT");
                    int nb_day_nxt_cpn = fieldData.GetElementAsInt32("DAYS_TO_NEXT_COUPON");
                    double cpn = fieldData.GetElementAsFloat64("CPN");
                    int cpn_freq = fieldData.GetElementAsInt32("CPN_FREQ");
                    double px_emit = fieldData.GetElementAsFloat64("WORKOUT_PX_BID");

                    int rating = Rating.GetQuality(fieldData);
                    govt = new Govt(security, d_title[security].Item1, country, currency, name, px_last, id_Mcorp, name_Mcorp, rating, d_title[security].Item2, date_cpn, maturity, duration, cpn, cpn_freq, nb_day_nxt_cpn, px_emit);

                    l_title.Add(govt);
                }
                else
                {
                    govt = new Govt(security,name, d_title[security].Item1, d_title[security].Item2, "Obligation ECHU, maturity : " + maturity);
                    l_err.Add(govt);
                }
            }
            catch (NotFoundException e)
            {
                govt = new Govt(security,name, d_title[security].Item1, d_title[security].Item2, e.Description());
                l_err.Add(govt);
            }
        }
开发者ID:RomainDAV,项目名称:TigerAppWPF,代码行数:41,代码来源:Connector.cs


注:本文中的Element.GetElementAsInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。