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


C# Element.HasElement方法代码示例

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


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

示例1: GetQuality

        public static int GetQuality(Element fieldData)
        {
            string rt_fitch = "", rt_sp = "", rt_moody = "";
            if (fieldData.HasElement("RTG_FITCH"))
                rt_fitch = fieldData.GetElementAsString("RTG_FITCH");
            if (fieldData.HasElement("RTG_SP_LT_LC_ISSUER_CREDIT"))
                rt_sp = fieldData.GetElementAsString("RTG_SP_LT_LC_ISSUER_CREDIT");
            if (fieldData.HasElement("RTG_MOODY"))
                rt_moody = fieldData.GetElementAsString("RTG_MOODY");

            return CalcRating(rt_fitch, rt_sp, rt_moody);
        }
开发者ID:RomainDAV,项目名称:TigerAppWPF,代码行数:12,代码来源:Rating.cs

示例2: 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

示例3: PrintField

        private void PrintField(Element field)
        {
            String fldDesc;

            string fldId = field.GetElementAsString(IdElementId);
            if (field.HasElement(FieldInfoElementId))
            {
                Element fldInfo = field.GetElement(FieldInfoElementId);
                string fldMnemonic = fldInfo.GetElementAsString(FieldMnemonicElementId);
                fldDesc = fldInfo.GetElementAsString(FieldDescElementId);

                Console.WriteLine(PadString(fldId, ID_LEN) +
                                  PadString(fldMnemonic, MNEMONIC_LEN) +
                                  PadString(fldDesc, DESC_LEN));
            }
            else
            {
                Element fldError = field.GetElement(FieldErrorElementId);
                fldDesc = fldError.GetElementAsString(FieldMsgElementId);

                Console.WriteLine("\n ERROR: " + fldId + " - " + fldDesc);
            }
        }
开发者ID:tweakch,项目名称:TweakToolkit,代码行数:23,代码来源:FieldSearchEventHandler.cs

示例4: IsValid

 private static bool IsValid(Element fieldData)
 {
     return fieldData.HasElement(DATE)
                     && fieldData.HasElement(PX_LAST)
                     && fieldData.HasElement(VWAP_VOLUME)
                     && fieldData.HasElement(VWAP_LIT_VOLUME);
 }
开发者ID:jbontik,项目名称:bloomberg_downloader,代码行数:7,代码来源:Program.cs


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