using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Linq; using System.Globalization; namespace Windows.Azure.Storage { public class QueueResponse : StorageResponse { public QueueResponse(StorageResponse response) { base.ResponseMessage = response.ResponseMessage; base.ResponseHeaders = response.ResponseHeaders; base.ResponseCode = response.ResponseCode; base.ResponseBody = response.ResponseBody; } public List GetQueueMessages() { var messages = from message in XDocument.Parse(ResponseBody).Root.Descendants("QueueMessage") select new QueueMessage { MessageId = new Guid(message.Element("MessageId").Value), InsertionTime = DateTime.Parse(message.Element("InsertionTime").Value, CultureInfo.InvariantCulture), ExpirationTime = DateTime.Parse(message.Element("ExpirationTime").Value, CultureInfo.InvariantCulture), PopReceipt = message.Element("PopReceipt").Value, TimeNextVisible = DateTime.Parse(message.Element("TimeNextVisible").Value, CultureInfo.InvariantCulture), MessageText = message.Element("MessageText").Value }; return messages.ToList(); } } }