本文整理汇总了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);
}
示例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)));
}
}
}
}
示例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);
}
}
示例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);
}