/// <summary> /// Gets the field value from the BloombergData BBField collection. /// </summary> /// <param name="instrument">The instrument.</param> /// <param name="fieldName">Name of the field.</param> /// <returns></returns> private static object GetFieldValue(BloombergDataInstrument instrument, string fieldName) { object fieldValue = null; try { if (instrument.BBFields != null) { if (instrument.BBFields.ContainsKey(fieldName)) { //fieldValue = instrument.BBFields[fieldName].Value; fieldValue = instrument.BBFields[fieldName]; } } } catch { fieldValue = null; } return(fieldValue); }
/// <summary> /// Gets the date time value from the BloombergData BBField collection. /// </summary> /// <param name="instrument">The instrument.</param> /// <param name="fieldName">Name of the field.</param> /// <returns></returns> public static DateTime?GetDateTime(BloombergDataInstrument instrument, string fieldName) { object fieldValue = GetFieldValue(instrument, fieldName); return(GetDateTime(fieldValue)); }
/// <summary> /// Gets the int value from the BloombergData BBField collection. /// </summary> /// <param name="instrument">The instrument.</param> /// <param name="fieldName">Name of the field.</param> /// <returns></returns> public static int?GetInt(BloombergDataInstrument instrument, string fieldName) { object fieldValue = GetFieldValue(instrument, fieldName); return(GetInt(fieldValue)); }
/// <summary> /// Gets the decimal value from the BloombergData BBField collection. /// </summary> /// <param name="instrument">The instrument.</param> /// <param name="fieldName">Name of the field.</param> /// <returns></returns> public static decimal?GetDecimal(BloombergDataInstrument instrument, string fieldName) { object fieldValue = GetFieldValue(instrument, fieldName); return(GetDecimal(fieldValue)); }