Example #1
0
        /// <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);
        }
Example #2
0
        /// <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));
        }
Example #3
0
        /// <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));
        }
Example #4
0
        /// <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));
        }