internal static void Parse(string exchangeCode,XmlNode transactionNode, List<Transaction> transactions, List<Order> orders, List<OrderRelation> orderRelations) { Transaction transaction = new Transaction(); transaction.Initialize(transactionNode); transactions.Add(transaction); foreach (XmlNode orderNode in transactionNode.ChildNodes) { Order order = new Order(); CommandConvertor.Parse(orderNode,transaction,out order); orders.Add(order); foreach (XmlNode orderRelationNode in orderNode.ChildNodes) { string openOrderPrice = string.Empty; string openOrderID = orderRelationNode.Attributes["OpenOrderID"].Value; Guid openOrderId = new Guid(openOrderID); decimal closeLot = decimal.Parse(orderRelationNode.Attributes["ClosedLot"].Value); if (_OrderRelationOpenPrics.ContainsKey(openOrderID)) { openOrderPrice = _OrderRelationOpenPrics[openOrderID]; } else { openOrderPrice = ExchangeData.GetOrderRelationOpenPrice(exchangeCode, openOrderID); _OrderRelationOpenPrics.Add(openOrderID, openOrderPrice); } OrderRelation relation = new OrderRelation(order.Id, openOrderId, closeLot, openOrderPrice); orderRelations.Add(relation); } } }
internal static void Parse(string exchangeCode,XmlNode transactionNode, out Transaction[] transactions,out Order[] orders, out OrderRelation[] orderRelations) { List<Transaction> transactionList = new List<Transaction>(); List<Order> orderList = new List<Order>(); List<OrderRelation> orderRelationList = new List<OrderRelation>(); CommandConvertor.Parse(exchangeCode,transactionNode, transactionList, orderList, orderRelationList); transactions = transactionList.ToArray(); orders = orderList.ToArray(); orderRelations = orderRelationList.ToArray(); }
private static void Parse(XmlNode orderNode, Transaction transaction, out Order order) { order = new Order(); order.TransactionId = transaction.Id; order.Initialize(orderNode); }