示例#1
0
        private List<Message> GenerateMessages()
        {
            List<Message> result = new List<Message>();
            var rreq = (RequestReference)base._request;

            var securities = new Dictionary<string, Dictionary<string, object>>();
            foreach (var security in rreq.Securities)
            {
                if (!securities.ContainsKey(security))
                {
                    bool isOption = Regex.IsMatch(security.ToUpper(), @"[A-Z]{1,4}\s+\d{6}[CP]\d{8} EQUITY"); //options look like: AAPL 150117C00600000 EQUITY

                    var fieldData = new Dictionary<string, object>();
                    securities.Add(security, fieldData);

                    List<string> badFields = new List<string>();
                    foreach (var field in rreq.Fields)
                    {
                        object value = Types.RandomDataGenerator.ReferenceDataFromFieldName(field, security, isOption, rreq);
                        if (value != null)
                        {
                            fieldData.Add(field.ToUpper(), value);
                        }
                    }
                }
            }

            MessageReference msg = new MessageReference(base._request.correlationId, securities);
            result.Add(msg);

            return result;
        }
示例#2
0
 internal ElementReference(MessageReference arg)
 {
     this._securities = new ElementReferenceSecurityDataArray((ElementReferenceSecurityDataArray)arg.Elements.First());
 }
示例#3
0
 internal ElementReference(MessageReference arg)
 {
     this._securities = new ElementReferenceSecurityDataArray((ElementReferenceSecurityDataArray)arg.Elements.First());
 }