/// <summary> /// Process a list of curves in a response from the BLP API. /// Not fully implemented yet - does not collect results /// </summary> /// <param name="msg"></param> private void ProcessCurveListResponse(Message msg) { Element results = msg.GetElement(RESULTS_ELEMENT); int numResults = results.NumValues; Console.WriteLine("Processing " + numResults + " results:"); for (int i = 0; i < numResults; ++i) { Element result = results.GetValueAsElement(i); StringBuilder sb = new StringBuilder(); foreach (Name n in CURVE_RESPONSE_ELEMENTS) { if (sb.Length != 0) { sb.Append(" "); } sb.Append(n).Append("=").Append(result.GetElementAsString(n)); } Console.WriteLine( "\t{0} {1} - {2} '{3}'", i + 1, result.GetElementAsString(CURVE_ELEMENT), result.GetElementAsString(DESCRIPTION_ELEMENT), sb.ToString()); } }
/// <summary> /// Process a list of instruments in a response from the BLP API. /// </summary> /// <param name="msg"></param> private void ProcessInstrumentListResponse(Message msg) { Element results = msg.GetElement(RESULTS_ELEMENT); for (int i = 0; i < results.NumValues; i++) { instrument_results.Add(results.GetValueAsElement(i).GetElementAsString(SECURITY_ELEMENT)); } }
/// <summary> /// Process a list of Govt instances in a response from the BLP API. /// Not fully implemented yet - does not collect results /// </summary> /// <param name="msg"></param> private void ProcessGovtListResponse(Message msg) { Element results = msg.GetElement(RESULTS_ELEMENT); int numResults = results.NumValues; Console.WriteLine("Processing " + numResults + " results:"); for (int i = 0; i < numResults; ++i) { Element result = results.GetValueAsElement(i); Console.WriteLine( "\t{0} {1}, {2} - {3}", i + 1, result.GetElementAsString(PARSEKY_ELEMENT), result.GetElementAsString(NAME_ELEMENT), result.GetElementAsString(TICKER_ELEMENT)); } }