本文整理汇总了C#中Element.GetElementAsString方法的典型用法代码示例。如果您正苦于以下问题:C# Element.GetElementAsString方法的具体用法?C# Element.GetElementAsString怎么用?C# Element.GetElementAsString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element.GetElementAsString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SecurityError
public SecurityError(Element securityError)
{
_securityError = securityError;
_source = _securityError.GetElementAsString("source");
_code = _securityError.GetElementAsString("code");
_category = _securityError.GetElementAsString("category");
_message = _securityError.GetElementAsString("message");
_subcategory = _securityError.GetElementAsString("subcategory");
}
示例2: 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);
}
示例3: ParseEquity
public void ParseEquity(Element fieldData)
{
string tenor = fieldData.GetElementAsString("ID_BB_SEC_NUM_DES");
double px_mid = fieldData.GetElementAsFloat64("PRIOR_CLOSE_MID");
tenor = tenor.Replace(isin,"");
pointsCourbe.Add(TenorToDate(tenor), px_mid);
}
示例4: 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);
}
}
示例5: 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)));
}
}
}
}
示例6: printErrorInfo
private void printErrorInfo(string leadingStr, Element errorInfo)
{
Logger.Error(leadingStr + errorInfo.GetElementAsString(CATEGORY) +
" (" + errorInfo.GetElementAsString(MESSAGE) + ")");
}
示例7: printErrorInfo
private void printErrorInfo(string leadingStr, Element errorInfo)
{
Console.WriteLine(@"{0}{1} ({2})", leadingStr, errorInfo.GetElementAsString(Category), errorInfo.GetElementAsString(MESSAGE));
}
示例8: 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);
}
示例9: 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);
}
示例10: 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);
}
}
示例11: ParseEquity
private static void ParseEquity(Element fieldData, string security)
{
string country = fieldData.GetElementAsString("COUNTRY_ISO");
double px_last = fieldData.GetElementAsFloat64("PX_LAST");
string currency = fieldData.GetElementAsString("CRNCY");
string name = fieldData.GetElementAsString("NAME");
Equity equit = new Equity(security, d_title[security].Item1, country, currency, name, px_last);
l_title.Add(equit);
}
示例12: ParseCorp
private static void ParseCorp(Element fieldData, string security)
{
string dateBack = fieldData.GetElementAsString("WORKOUT_DT_BID");
string dateEmit = fieldData.GetElementAsString("ISSUE_DT");
string name = fieldData.GetElementAsString("NAME");
curve.GetValue(dateEmit);
Corp corp = new Corp(security, d_title[security].Item1, d_title[security].Item2, dateEmit, dateBack, name);
l_title.Add(corp);
}