public void Parse(Stream stream) { Dictionary <string, string> cancel = XmlToDictionary.StreamToDictionary(stream); this.Result = cancel.ContainsKey("result") ? cancel["result"] : ""; this.AccountId = cancel.ContainsKey("account-id") ? cancel["account-id"] : ""; this.OrderId = cancel.ContainsKey("order-id") ? cancel["order-id"] : ""; this.Message = cancel.ContainsKey("message") ? cancel["message"] : ""; this.Error = cancel.ContainsKey("error") ? cancel["error"] : ""; }
public void Parse(Stream stream) { Dictionary <string, string> trade = XmlToDictionary.StreamToDictionary(stream); this.ClientOrderId = trade.ContainsKey("client-order-id") ? trade["client-order-id"] : ""; this.OrderString = trade.ContainsKey("orderstring") ? trade["orderstring"] : ""; this.Result = trade.ContainsKey("result") ? trade["result"] : ""; this.Error = trade.ContainsKey("error") ? trade["error"] : ""; this.AccountId = trade.ContainsKey("account-id") ? trade["account-id"] : ""; this.Symbol = trade.ContainsKey("symbol") ? trade["symbol"] : ""; this.Description = trade.ContainsKey("description") ? trade["description"] : ""; this.AssetType = trade.ContainsKey("asset-type") ? trade["asset-type"] : ""; this.Exchange = trade.ContainsKey("exchange") ? trade["exchange"] : ""; this.Quantity = trade.ContainsKey("quantity") ? trade["quantity"] : ""; this.OrderId = trade.ContainsKey("order-id") ? trade["order-id"] : ""; this.Action = trade.ContainsKey("action") ? trade["action"] : ""; this.TradeType = trade.ContainsKey("trade-type") ? trade["trade-type"] : ""; this.OrderType = trade.ContainsKey("order-type") ? trade["order-type"] : ""; this.LimitPrice = trade.ContainsKey("limit-price") ? trade["limit-price"] : ""; this.StopPrice = trade.ContainsKey("stop-price") ? trade["stop-price"] : ""; }