private ReferenceDataRequestInfo RegisterNewRequest(out Request request) { var info = new ReferenceDataRequestInfo(Securities, Fields); request = CreateRequest(info); return(info); }
public void SendRequestAsync(Action <ReferenceDataResponse> callback) { Request request; ReferenceDataRequestInfo info = RegisterNewAsyncRequest(out request, callback); SessionWrapper.RequestDescriptions.Add(info.Id, info); SessionWrapper.SendRequestAsync(request, info.Id); }
private ReferenceDataRequestInfo RegisterNewAsyncRequest(out Request request, Action <ReferenceDataResponse> callback) { ReferenceDataRequestInfo info = RegisterNewRequest(out request); info.Callback = callback; return(info); }
private Request CreateRequest(ReferenceDataRequestInfo desc) { Service service = SessionWrapper.GetService(); Request request = service.CreateRequest("ReferenceDataRequest"); FillRequest(request, desc); return(request); }
private SecurityData(ReferenceDataRequestInfo referenceDataRequest) { Fields = new Dictionary <string, FieldData>(); FieldExceptions = new HashSet <FieldException>(); foreach (string field in referenceDataRequest.Fields) { Fields.Add(field, null); } }
public override CorrelationID SendRequestAsync() { Request request; ReferenceDataRequestInfo info = RegisterNewRequest(out request); Console.WriteLine("Sending Request: " + request); SessionWrapper.RequestDescriptions.Add(info.Id, info); SessionWrapper.SendRequestAsync(request, info.Id); return(info.Id); }
public override void ProcessEvent(Event eventObj, BloombergSessionWrapper session) { foreach (Message msg in eventObj) { ReferenceDataRequestInfo requestDescription = session.RequestDescriptions[msg.CorrelationID]; requestDescription.Response.SaveMessage(msg); if (requestDescription.Callback != null && eventObj.Type == Event.EventType.RESPONSE) { requestDescription.Callback(requestDescription.Response); } } }
public static void FillRequest(Request request, ReferenceDataRequestInfo desc) { Element securities = request.GetElement("securities"); Element fields = request.GetElement("fields"); foreach (string security in desc.Tickers) { securities.AppendValue(security); } foreach (string field in desc.Fields) { fields.AppendValue(field); } }
public ReferenceDataResponse(ReferenceDataRequestInfo info) { Info = info; CorrelationID = info.Id; InitializeResponse(); }