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

            var badFields = new List <string>();

            for (int i = hreq.Fields.Count - 1; i >= 0; i--)
            {
                if (Types.Rules.IsBadField(hreq.Fields[i]))
                {
                    badFields.Add(hreq.Fields[i]);
                    hreq.Fields.RemoveAt(i);
                }
            }

            foreach (var security in hreq.Securities)
            {
                var fieldData = new Dictionary <DateTime, Dictionary <string, object> >();
                if (hreq.DtStart.HasValue)
                {
                    foreach (var dtCurrent in hreq.GetDates())
                    {
                        if ((dtCurrent.DayOfWeek != DayOfWeek.Sunday) && (dtCurrent.DayOfWeek != DayOfWeek.Saturday))
                        {
                            var fields = new Dictionary <string, object>();
                            fieldData.Add(dtCurrent, fields);

                            foreach (var field in hreq.Fields)
                            {
                                fields.Add(field, Types.RandomDataGenerator.RandomDouble());
                            }
                        }
                    }
                }

                HistoricMessage msg = new HistoricMessage(base._request.correlationId, security, badFields, fieldData, result.Count);
                result.Add(msg);
            }

            return(result);
        }
示例#2
0
 internal HistoricElementReference(HistoricMessage msg)
 {
     this._security = (HistoricElementSecurityData)msg.Elements.First();
 }